user3905353
user3905353

Reputation: 77

Node npm install -g express generator

I get the following message after npm install -g express generator install. I have tried everything I know how to fixed this. Is there another way for me to install this without getting this error message?

npm ERR! System Darwin 13.3.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express" "generator"
npm ERR! cwd /Users/abdulaleemseyed
npm ERR! node -v v0.10.30
npm ERR! npm -v 1.4.21
npm ERR! path /usr/local/lib/node_modules/generator
npm ERR! fstream_path /usr/local/lib/node_modules/generator
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'
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/abdulaleemseyed/npm-debug.log
npm ERR! not ok code 0
Abdulaleems-MacBook-Pro:~ abdulaleemseyed$ 

Upvotes: 1

Views: 2615

Answers (1)

puneet gupta
puneet gupta

Reputation: 383

Use sudo before npm install.Because you have to give permission to write in /usr/lib/ when you are installing globally. so use sudo npm install express-generator -g.

Upvotes: 1

Related Questions