isaacs/npm — Issue #1729: error installing npm@1.0.106 Error: EACCES, permission denied - OS X 10.6.8 - 'npm' command no longer recognized
Author: busticated
Created: 2011-11-17 17:39:56+00:00
State: open

Hey there -

I've been living with this issue for a while now thinking it was probably just my noobishness or that it'd get sorted in a future update or some such. Well... -1 on wishful thinking :-/

Whenever I try to 'npm update' without using 'sudo', I get the error below... then the 'npm' command becomes unusable ( '-bash: /usr/local/bin/npm: No such file or directory' ).

Here's an example:

>>npm update -g
npm ERR! error installing npm@1.0.106 Error: EACCES, permission denied '/usr/local/lib/node_modules/npm/.gitignore'
npm ERR! error rolling back npm@1.0.106 Error: EACCES, permission denied '/usr/local/lib/node_modules/npm/.gitignore'
npm ERR! Error: EACCES, permission denied '/usr/local/lib/node_modules/npm/.gitignore'
npm ERR! Report this *entire* log at:
npm ERR!
npm ERR! or email it to:
npm ERR!
npm ERR!
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "update" "-g"
npm ERR! cwd /Users/mattmirande/Sites/chzbrgr/icanhaz/wp-content/themes/UTClean
npm ERR! node -v v0.6.1
npm ERR! npm -v 1.0.105
npm ERR! path /usr/local/lib/node_modules/npm/.gitignore
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/mattmirande/Sites/chzbrgr/icanhaz/wp-content/themes/UTClean/npm-debug.log
npm not ok

Full log here: http://dl.dropbox.com/u/4584460/npm/npm-debug.log

In order to get things working again, I just reinstall npm using the one-liner on the site (plus 'sudo' before 'sh' as it fails without it).

I'm almost certain this is an issue with my config... but to be fair, I've pretty much just used defaults from the get-go (my machine is new, didn't do anything fancy with my env, etc)

I do use homebrew to install and update node and git and some other things... not sure if that matters?

Anyway, *many* thanks in advance for any tips / pointers on how to get this all properly sorted.
-matt