I am getting a very odd error trying to install the express-generator with and without sudo
.
I need to run: npm install express-generator -g
and then express --ejs name_here
but when executing the first command, I get the following error:
npm ERR! Darwin 15.2.0
npm ERR! argv "node" "/usr/local/bin/npm" "install" "express-generator" "-g"
npm ERR! node v0.12.7
npm ERR! npm v2.11.3
npm ERR! path /Users/[name]/.npm/lib/node_modules/express-generator/LICENSE
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! Error: EACCES, unlink '/Users/[name]/.npm/lib/node_modules/express-generator/LICENSE'
npm ERR! at Error (native)
npm ERR! { [Error: EACCES, unlink '/Users/[name]/.npm/lib/node_modules/express-generator/LICENSE']
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! path: '/Users/[name]/.npm/lib/node_modules/express-generator/LICENSE' }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR! error rolling back Error: EACCES, unlink '/Users/[name]/.npm/lib/node_modules/express-generator/LICENSE'
npm ERR! error rolling back at Error (native)
npm ERR! error rolling back { [Error: EACCES, unlink '/Users/[name]/.npm/lib/node_modules/express-generator/LICENSE']
npm ERR! error rolling back errno: -13,
npm ERR! error rolling back code: 'EACCES',
npm ERR! error rolling back path: '/Users/[name]/.npm/lib/node_modules/express-generator/LICENSE' }
npm ERR! Please include the following file with any support request:
npm ERR! /Users/[name]/Documents/Projects/MEAN Stack Tutorial/npm-debug.log
After trying sudo npm install express-generator -g
I get this:
/Users/[name]/.npm/bin/express -> /Users/[name]/.npm/lib/node_modules/express-generator/bin/express
express-generator@4.13.1 /Users/[name]/.npm/lib/node_modules/express-generator
├── sorted-object@1.0.0
├── commander@2.7.1 (graceful-readlink@1.0.1)
└── mkdirp@0.5.1 (minimist@0.0.8)
Then running express --ejs name_here
returns -bash: express: command not found
Is there a way I can solve this issue? The other questions on SO seem to have fixed the issue by trying sudo but not for me.