Jonathan Beech
Jonathan Beech

Reputation: 529

Yeoman web app generator not working

I'm attempting to create my first Yeoman webapp using the webapp generator. However I get the following errors:

npm http GET https://registry.npmjs.org/generator-webapp
npm http 304 https://registry.npmjs.org/generator-webapp
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/generator-webapp'
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/generator-webapp']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/generator-webapp',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/generator-webapp',
npm ERR!   fstream_class: 'DirWriter',
npm ERR!   fstream_stack:
npm ERR!    [ '/usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23',
npm ERR!      '/usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53',
npm ERR!      'Object.oncomplete (fs.js:107:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 12.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "generator-webapp"
npm ERR! cwd /Users/jonmacbook/Desktop/yeoman-demo
npm ERR! node -v v0.10.24
npm ERR! npm -v 1.3.21
npm ERR! path /usr/local/lib/node_modules/generator-webapp
npm ERR! fstream_path /usr/local/lib/node_modules/generator-webapp
npm ERR! fstream_type Directory
npm ERR! fstream_class DirWriter
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/usr/local/lib/node_modules/generator-webapp'
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:36:23
npm ERR! fstream_stack /usr/local/lib/node_modules/npm/node_modules/mkdirp/index.js:37:53
npm ERR! fstream_stack Object.oncomplete (fs.js:107:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/jonmacbook/Desktop/yeoman-demo/npm-debug.log
npm ERR! not ok code 0


I just installed your generator by running:

    npm install -g generator-webapp

I am pretty sure that node js and yeoman were installed ok. Is there a permissions issue or path issue?

Upvotes: 0

Views: 1133

Answers (2)

Ryan Ore
Ryan Ore

Reputation: 1345

I thought I was crazy but a lot of people were having the same problem as me.

This may or may not be the right answer for you but, for me it was do a fresh install of node/npm. I really didn't want to because it sounded like opening a can of worms but it's not as bad as it sounds. Within 15 minutes all my Yeoman generators are working and my permissions are good.

@Dominic Tancredi lays it out nicely, and then just see through using NVM to install fresh node. https://stackoverflow.com/a/11178106/1118070

Upvotes: 1

publiclass1
publiclass1

Reputation: 91

We have the same error, I fixed this by changing the user owner by

chown my_username:my_username ~/.config/configstore/update-notifier-yo.yml

then after that, another error occurred,

npm ERR! stack Error: EACCES, open /home/my_username/.npm/chalk/0.4.0/package/package.json

then change again the owner of ~/.npm directory.

then solved the problem. Hope it will helpful.

Upvotes: 0

Related Questions