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
.
--no-bin-links
--no-bin-links
tells npm to not create any symbolic links.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With