expressjs / generator

Express' application generator
MIT License
1.82k stars 550 forks source link

Failing to install over an old `express` installation #21

Closed hacksparrow closed 10 years ago

hacksparrow commented 10 years ago

I had an old installation of express (3.4.8), when I tried sudo npm install -g express-generator, I got this:

npm http GET https://registry.npmjs.org/express-generator
npm http 304 https://registry.npmjs.org/express-generator
npm ERR! error rolling back Error: Refusing to delete: /usr/local/bin/express not in /usr/local/lib/node_modules/express-generator
npm ERR! error rolling back     at clobberFail (/usr/local/lib/node_modules/npm/lib/utils/gently-rm.js:57:12)
npm ERR! error rolling back     at next (/usr/local/lib/node_modules/npm/lib/utils/gently-rm.js:43:14)
npm ERR! error rolling back     at /usr/local/lib/node_modules/npm/lib/utils/gently-rm.js:52:12
npm ERR! error rolling back     at Object.oncomplete (fs.js:107:15)
npm ERR! error rolling back  express-generator@4.0.0 { [Error: Refusing to delete: /usr/local/bin/express not in /usr/local/lib/node_modules/express-generator] code: 'EEXIST', path: '/usr/local/bin/express' }
npm ERR! Refusing to delete: /usr/local/bin/express not in /usr/local/lib/node_modules/express-generator
File exists: /usr/local/bin/express
Move it away, and try again.

npm ERR! System Darwin 13.1.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "-g" "express-generator"
npm ERR! cwd /Users/yaapa/hacklab
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! path /usr/local/bin/express
npm ERR! code EEXIST
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/yaapa/hacklab/npm-debug.log
npm ERR! not ok code 0

I resolved it by manually deleting /usr/local/bin/express, but someone inexprienced may be left scratching their head. It would be great if this case is handled seamlessly.

dougwilson commented 10 years ago

This is handled by npm; there is nothing the module author (us) can do to force the delete when you install this module.

hacksparrow commented 10 years ago

Thanks. Hope this serves as a heads up for anyone else encountering the issue.