I'm running an Amazon Linux AMI and successfully installed node.js by
wget'ing the source, untarring the file, and running
./configure and then
sudo make install. When I installed npm:
curl http://npmjs.org/install.sh | sudo sh
npm cannot be installed without nodejs. Install node first, and then try again. Maybe node is installed, but not in the PATH? Note that running as sudo can change envs. PATH=/sbin:/bin:/usr/sbin:/usr/bin
But node is clearly installed (running
node -v shows its version), so it must be that node is not in my path.
~/.bash_profile and add this line:
and try to install npm again, only to find that it outputs the same message as last time, which the exact same PATH.
Then, the weird thing is that I notice that npm is actually installed! Running
npm -v shows its version. Hm....
Then I run
npm install supervisor in the directory of my app, and the supervisor folder is there in
/node_modules, however the
supervisor command does not exist.
Installing supervisor outputs:
npm WARN prefer global email@example.com should be installed with -g
so I try
npm install -g supervisor which outputs
npm ERR! Error: EACCES, mkdir '/usr/local/lib/node_modules/supervisor' npm ERR! npm ERR! Please try running this command again as root/Administrator.
so I try
sudo npm install -g supervisor
but the output is
sudo: npm: command not found
So to sum up, npm seems to be working fine, although the output when installing it would lead one to believe otherwise, and the supervisor package seems like it's installed, but its command is not working.
Any help on figuring this out would be greatly appreciated!