I have no explanation, but a few pointers:
As @LaurentPerrin reports, node (via the official installer package) is installed on /usr/local/bin .
(Why are you mentioning ~/bin ?)
Please note that different rules apply if you use user level settings through node.js nvm version manager , in which case [symbolic links to] executable files are placed in ~/.nvm/v{version}/bin
Thus, the node executable should be /usr/local/bin/node .
Is this (only) what you see when you run which -a node ?
The executable node is placed directly in /usr/local/bin , while npm is just a symbolic link that points to /usr/local/lib/node_modules/npm/bin/npm-cli.js , which is an executable node script with the shebang line #!/usr/bin/env node .
At startup
ls -l /usr/local/bin/npm
you should see something like
lrwxr-xr-x 1 root wheel 38 Dec 13 11:52 /usr/local/bin/npm -> \ ../lib/node_modules/npm/bin/npm-cli.js
See if the symlink exists and points to the right file.
If this still doesn't work, try calling npm-cli.js and see what happens (this should show the npm command line help):
/usr/local/lib/node_modules/npm/bin/npm-cli.js help
source share