I have a problem related to nodejs. I have nodejs binaries here:
~/node-v8.5.0-linux-x64/ and I have a soft link that I created using:
ln -s node-v8.5.0-linux-x64/ node.
In my .bashrc, I have this:
npm are working great when I'm normally logged in. As both of them are installed in my home, I don't need to be logged in as root to install a package globally.
But I wanted to try; so, I ran:
sudo npm install -g angular-cli sudo node app.js
and it didn't work.
sudo: node : command not found
I thought maybe the
$PATH changes when I use
sudo but then I checked it using
sudo echo $PATH:
The shell should know where to go when I type
node command, but it seems it doesn't. I also tried
-u options for
sudo but none of that helps either.
Can someone please explain what's happening here?