I've had node.js installed on my Ubuntu 14.04 for a looong time. I installed nvm several months back, and things have always worked out fine. A couple of days ago, when I try to run a node script, I get the following:
me@here~$: node
he program 'node' can be found in the following packages:
* node
* nodejs-legacy
Try: sudo apt-get install <selected package>
If I then use nvm to specify that I want to use node (nvm use node
), things work again - until I close my terminal, or start a new session. Very annoying.
Of course, if I follow the suggested action and do
sudo apt-get install node
What gets installed is not node.js, but some other unrelated package.
question
What can I do so that running node
on any terminal session resolves to whatever nvm has previously set up?
Update
From one of the comments linking to the other question, this is how I solved this:
"I also like to add a line to the bottom my .bashrc like:
nvm use stable > /dev/null
That will automatically use the latest version you have installed."