Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EPROTO: protocol error, symlink '../semver/bin/semver' when using ember new

I have a Vagrant virtual machine created with ubuntu/trusty64 box (it runs Ubuntu 14.04.3 LTS (GNU/Linux 3.13.0-66-generic x86_64)) with Ruby on Rails, Node.js (5.x, but previously 0.12) and Ember CLI.

I'm trying to create a new Ember application by running ember new frontend and it always gives me some errors:

Successfully initialized git.
Installing packages for tooling via npm...
npm ERR! tar.unpack untar error /home/vagrant/.npm/underscore.string/2.3.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/underscore.string/2.3.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/underscore.string/2.3.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/underscore.string/2.3.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/underscore.string/2.3.3/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/acorn/1.2.2/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/npm/2.14.10/package.tgz
npm ERR! tar.unpack untar error /home/vagrant/.npm/bower/1.7.0/package.tgz
EPROTO: protocol error, symlink '../semver/bin/semver' -> '/vagrant/emberrails/frontend/node_modules/ember-cli-dependency-checker/node_modules/.bin/semver'
Error: EPROTO: protocol error, symlink '../semver/bin/semver' -> '/vagrant/emberrails/frontend/node_modules/ember-cli-dependency-checker/node_modules/.bin/semver'
    at Error (native)

Why? How can I fix this?

This problem occurs when I try to install some packages through NPM on my own, but then I add --no-bin-links to the command and it's all fine, but I don't have this option on ember new.

like image 312
Juliano Nunes Silva Oliveira Avatar asked Dec 11 '15 10:12

Juliano Nunes Silva Oliveira


2 Answers

 --no-bin-links

--no-bin-links tells npm to not create any symbolic links.

like image 140
user6947442 Avatar answered Nov 08 '22 09:11

user6947442


The reason symlink was failing on my windows box is that administrator permissions are required. Starting virtualbox as Administrator is required on windows to create the symbolic link, and vagrant will need to be run from an elevated command prompt [https://docs.vagrantup.com/v2/virtualbox/common-issues.html](in order to interact with virtualbox)

The solution in the past was

v.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/vagrant", "1"]

but this shouldn't be necessary, as this is the default behavior of virtualbox as of v1.1.

like image 4
kindasimple Avatar answered Nov 08 '22 09:11

kindasimple