2

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."

rodrigo-silveira
  • 12,607
  • 11
  • 69
  • 123
  • Related: [nodejs vs node on ubuntu 12.04](http://stackoverflow.com/questions/18130164/nodejs-vs-node-on-ubuntu-12-04) – Jonathan Lonowski Apr 23 '16 at 02:41
  • 1
    Specifically see the line in my answer to that question: `"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."` – Paul Apr 23 '16 at 02:48

1 Answers1

0

Package is called nodejs. Also you can just download node.js here https://nodejs.org/en/download/ (ex. wget https://nodejs.org/dist/v4.4.3/node-v4.4.3-linux-x64.tar.xz) and find node in bin/node.

vitaliydev
  • 420
  • 4
  • 7