yeoman / generator-polymer

Scaffold out a Polymer project
http://polymer-project.org
926 stars 150 forks source link

issue with npm and polymer-generator? #105

Closed rchrdnsh closed 9 years ago

rchrdnsh commented 9 years ago

When I try to create a new polymer-generator project i get this code at the end of the process:

web-animations-next#f915befcdc app/bower_components/web-animations-next
npm WARN package.json rykr-poly-2@0.0.0 No description
npm WARN package.json rykr-poly-2@0.0.0 No repository field.
npm WARN package.json rykr-poly-2@0.0.0 No README data
npm ERR! Error: EACCES, mkdir '/Users/richardnash/.npm/each-async/0.1.3'
npm ERR!  { [Error: EACCES, mkdir '/Users/richardnash/.npm/each-async/0.1.3']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/Users/richardnash/.npm/each-async/0.1.3',
npm ERR!   parent: 'grunt-minify-html' }
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"
npm ERR! cwd /Users/richardnash/Dropbox/Sites/rykr-poly-2
npm ERR! node -v v0.10.33
npm ERR! npm -v 1.4.28
npm ERR! path /Users/richardnash/.npm/each-async/0.1.3
npm ERR! code EACCES
npm ERR! errno 3
npm ERR! stack Error: EACCES, mkdir '/Users/richardnash/.npm/each-async/0.1.3'
npm ERR! not ok code 0
rn:rykr-poly-2 richardnash$

I do not know what commands that I am supposed to run again. I tried running sudo yo polymer, but the same issue arrises.

Not sure what to do here :-(

sindresorhus commented 9 years ago

If you scroll up the generator will tell you that it's running npm install for you.

Try upgrading npm and run npm cache clean.

rchrdnsh commented 9 years ago

I tried that once, but it did not work, although I may have done it incorrectly. I will try it again and report back to you if the issue is resolved. :-)

rchrdnsh commented 9 years ago

ok, I ran npm update and npm cache clean then generated a new project and it worked. Thank you Sindre :-)

bebekim commented 9 years ago

I am getting somewhat similar issue. I ran npm update and npm cache clean but still getting similar error.

goldenfermi (master #) ~ $ npm install -g generator-polymer
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/generator-polymer'
npm ERR!  { [Error: EACCES, mkdir '/usr/local/lib/node_modules/generator-polymer']
npm ERR!   errno: 3,
npm ERR!   code: 'EACCES',
npm ERR!   path: '/usr/local/lib/node_modules/generator-polymer',
npm ERR!   fstream_type: 'Directory',
npm ERR!   fstream_path: '/usr/local/lib/node_modules/generator-polymer',
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:46:53',
npm ERR!      'Object.oncomplete (fs.js:108:15)' ] }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! System Darwin 13.4.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "generator-polymer"
npm ERR! cwd /Users/goldenfermi
npm ERR! node -v v0.10.34
npm ERR! npm -v 1.4.28
npm ERR! path /usr/local/lib/node_modules/generator-polymer
npm ERR! fstream_path /usr/local/lib/node_modules/generator-polymer
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-polymer'
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:46:53
npm ERR! fstream_stack Object.oncomplete (fs.js:108:15)
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/goldenfermi/npm-debug.log
npm ERR! not ok code 0
ragingwind commented 9 years ago

take a look: http://stackoverflow.com/questions/16151018/npm-throws-error-without-sudo or the problem was only raised on generator-polymer?