/usr/local/bin/node
/usr/local/bin/npm
and PATH contains that path:
echo $PATH
output:
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin...
but when i try updating npm:
sudo npm update -g npm
i get:
sudo: npm: command not found
and "ls" confirms that it isn't installed:
sudo ls -la /usr/local/bin
output:
...
lrwxr-xr-x 1 nick admin 32 May 2 2014 mvnyjp -> ../Cellar/maven/3.2.1/bin/mvnyjp
-rwxr-xr-x 1 root admin 36046288 Jul 10 00:51 node
lrwxr-xr-x 1 root admin 45 May 12 15:40 protractor -> ../lib/node_modules/protractor/bin/protractor
-rwxr--r-- 1 nick staff 2757 Mar 2 12:11 pstorm
...
Chris Barber reports that /usr/local/bin/npm should be a symlink to /usr/local/lib/node_modules/npm/bin/npm-cli.js
i can run npm through node:
node /usr/local/lib/node_modules/npm/bin/npm-cli.js -v
outputs:
2.11.3
"ls"-ing "lib":
ls -la /usr/local/lib
shows a curious ownership/permission setting for "node_modules" directory:
drwxr-xr-x 6 24561 wheel 204 May 18 09:57 node_modules
to fix this, the solution seems to be as simple as creating that symlink:
sudo ln -s /usr/local/lib/node_modules/npm/bin/npm-cli.js /usr/local/bin/npm
i tried updating npm again:
sudo npm update -g npm
this time it outputs:
/usr/local/bin/npm -> /usr/local/lib/node_modules/npm/bin/npm-cli.js
npm@2.13.0 /usr/local/lib/node_modules/npm
:)