Skip to content
This repository was archived by the owner on Apr 22, 2023. It is now read-only.
This repository was archived by the owner on Apr 22, 2023. It is now read-only.

Running npm update -g kills npm install #2441

@jswartwood

Description

@jswartwood

I'm running node v0.6.6 and npm v1.1.0-beta-4 (the npm bundled w/ node) on osx.

I thought that npm update -g should be able to update npm to the latest version, but instead it fails because of permissions (I'm not surprised about this) and breaks the installed npm in the process (this is the issue).

My output:

$ npm update -g
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.0.106
npm http 304 https://registry.npmjs.org/npm/1.0.106
npm ERR! error installing [email protected]
npm ERR! error rolling back [email protected] Error: EACCES, permission denied '/usr/local/lib/node_modules/npm/.gitmodules'
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules/npm/.gitmodules'
npm ERR! Report this *entire* log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>
npm ERR! 
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "update" "-g"
npm ERR! cwd /Users/jswartwood
npm ERR! node -v v0.6.6
npm ERR! npm -v 1.1.0-beta-4
npm ERR! path /usr/local/lib/node_modules/npm/.gitmodules
npm ERR! code EACCES
npm ERR! message EACCES, permission denied '/usr/local/lib/node_modules/npm/.gitmodules'
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/jswartwood/npm-debug.log
npm not ok
$ npm
-bash: /usr/local/bin/npm: No such file or directory

The problem is solved via running with sudo instead...

$ sudo npm update -g
Password:
npm http GET https://registry.npmjs.org/npm
npm http 304 https://registry.npmjs.org/npm
npm http GET https://registry.npmjs.org/npm/1.0.106
npm http 304 https://registry.npmjs.org/npm/1.0.106
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npm_g -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
/usr/local/bin/npm-g -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
[email protected] /usr/local/lib/node_modules/npm

...but the permissions problem should simply throw an error and fail gracefully, and not require a node/npm reinstall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions