isaacs/npm — Issue #2233: EPERM operation not permitted with one-line install
Author: tstatler
Created: 2012-03-06 20:27:54+00:00
State: open

I'm on OS X, and the one-line install instructions failed on my system an error (below). It works if I add an extra sudo after the pipe, e.g.

```
sudo curl http://npmjs.org/install.sh | sudo sh
```

Without the extra sudo, I get this error.

```
Error: EPERM, operation not permitted '/usr/local/bin/npm'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Darwin 10.8.0
npm ERR! command "/usr/local/bin/node" "/private/var/folders/Lx/LxqWsT7xF4af1f87koWOBU+++TI/-Tmp-/npm.12410/package/cli.js" "install" "-gf"
npm ERR! cwd /private/var/folders/Lx/LxqWsT7xF4af1f87koWOBU+++TI/-Tmp-/npm.12410/package
npm ERR! node -v v0.6.11
npm ERR! npm -v 1.1.4
npm ERR! path /usr/local/bin/npm
npm ERR! code EPERM
npm ERR! message EPERM, operation not permitted '/usr/local/bin/npm'
npm ERR! errno {}
```