0

I am trying to set up an AngularJS site using Yeoman:

$ yo angular

The installation is partly successful. The directory is being populated with all those files, but there are also several errors that left me wondering if the init was complete:

npm ERR! Error: EACCES, symlink '../grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer'
npm ERR!  { [Error: EACCES, symlink '../grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '../grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.2.0-56-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install"
npm ERR! cwd /home/username/Development/LearnAngularJS
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! path ../grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, symlink '../grunt-autoprefixer/node_modules/autoprefixer/bin/autoprefixer'

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/username/Development/LearnAngularJS/npm-debug.log
npm ERR! not ok code 0
npm ERR! Error: EACCES, symlink '../karma/bin/karma'
npm ERR!  { [Error: EACCES, symlink '../karma/bin/karma'] errno: 3, code: 'EACCES', path: '../karma/bin/karma' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Linux 3.2.0-56-generic
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "grunt-karma" "karma-ng-html2js-preprocessor" "karma-ng-scenario" "--save-dev"
npm ERR! cwd /home/username/Development/LearnAngularJS
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! path ../karma/bin/karma
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, symlink '../karma/bin/karma'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/username/Development/LearnAngularJS/npm-debug.log
npm ERR! not ok code 0

I am not sure why I'd need to run the init as root, that doesn't seem right. Where exactly is it looking (and failing) for those paths "../grunt-autoprefixer/node_modules", "../karma/bin/karma"? And, of course, what should I do to fix this behaviour?

Passiday
  • 7,573
  • 8
  • 42
  • 61
  • Did you see [this](http://stackoverflow.com/questions/19352976/npm-modules-wont-install-globally-without-sudo). Did you install node with sudo? – Pippin Dec 03 '13 at 01:24
  • Yes, I did `sudo apt-get install nodejs`. Should I now roll back and install it without sudo? – Passiday Dec 03 '13 at 06:20
  • Yes, apt-get remove it and then follow the instructions at https://github.com/joyent/node/wiki/Installing-Node.js-via-package-manager#ubuntu-mint-elementary-os to install node. Another thing I do is change the npm prefix to a place my user has write access to so I never need sudo with npm – Eddie Monge Jr Dec 03 '13 at 22:22
  • Well, now I'm puzzled. The link you give explicitly instructs to install the nodejs package as root. I did that already previously. But then, trying to install Yeoman with `npm install -g yo` results in several errors asking me to run it with sudo. – Passiday Dec 03 '13 at 22:34
  • Ok, I see, I install the npm with sudo, but then all the npm packages are installed locally without the -g switch. – Passiday Dec 03 '13 at 22:55

1 Answers1

0

Is this inside a VirtualBox or Vagrant shared folder? I got the same error and found it was because VirtualBox 4.18+ does not support symlinks inside shared folders: https://www.virtualbox.org/ticket/10085

zvikara
  • 1,597
  • 3
  • 13
  • 19