This question already has an answer here:
I have been running into issues with my Ubuntu server (EC2 instance) where I installed NVM (Node Version Manager) under the default
ubuntu user that Amazon provides you (Also the recommended installation) and then installed node with npm version via NVM to the following path,
$which node /home/ubuntu/.nvm/versions/node/v6.12.3/bin/node $which npm /home/ubuntu/.nvm/versions/node/v6.12.3/bin/npm
with $PATH equal to:
but when I try to run
sudo commands it is not picking up on
node and after some research I’m curious if it has to do with either of the following reasons or if it is something I’m not noticing.
- Issue specific to Ubuntu where “node” is associated with a different package, so “nodejs” had to be used?
- nvm, node and npm need to be installed with
sudoso path can be accessed by root
sudo npm install sudo: npm: command not found sudo node run sudo: node: command not found
Here are additional environment variables that might be helpful:
HOME=/home/ubuntu NVM_DIR=/home/ubuntu/.nvm USER=ubuntu
Error message sent from deployment logs:
[stderr]/usr/bin/env: ‘node’: No such file or directory