Yeoman Angularjs Generator issue-Mac

316 Views Asked by At

I've seen other similar Yeoman issues regarding the angular generator, but none addressing this particular error. The yo doctor command tells me everything is good and then when I try to run $ npm install -g generator-angularI get the following message. I'm not sure if its a permissions problem or what. I would be grateful for any help.

Christophers-MacBook-Pro% npm install -g generator-angular
npm ERR! Error: EACCES, unlink '/usr/local/lib/node_modules/generator-angular'
npm ERR!  { [Error: EACCES, unlink '/usr/local/lib/node_modules/generator-angular']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/generator-angular' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 14.0.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "generator-angular"
npm ERR! cwd /Users/christopherfristoe
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/lib/node_modules/generator-angular
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, unlink '/usr/local/lib/node_modules/generator-angular'
npm ERR! error rolling back Error: EACCES, unlink '/usr/local/lib/node_modules/generator-angular'
npm ERR! error rolling back  { [Error: EACCES, unlink '/usr/local/lib/node_modules/generator- angular']
npm ERR! error rolling back   errno: 3,
npm ERR! error rolling back   code: 'EACCES',
npm ERR! error rolling back   path: '/usr/local/lib/node_modules/generator-angular' }
npm ERR! not ok code 0
Christophers-MacBook-Pro%
1

There are 1 best solutions below

0
On

Your user does not have proper access to the /usr/local/lib/node_modules directory. This is where npm is trying to place the libraries.

Run the following command with your username inserted in place of 'username':

sudo chown -R 'username' /usr/local/lib/node_modules

and then re-run your original command.