Raj Kumar
Raj Kumar

Reputation: 13

How to update the already installed nodejs in ubuntu

If i update the old version that not updated only displayed my current version( v0.10.37). so tell me how to update the version of nodejs in ubuntu.

Upvotes: 0

Views: 154

Answers (1)

Rian O'Dwyer
Rian O'Dwyer

Reputation: 435

Couple of options here. There's a tool called nvm: https://github.com/creationix/nvm

I haven't tried this yet so no opinion on it either way.

Or

You can do it via the n package for npm https://www.npmjs.com/package/n

Ensure you have everything backed up and can roll back if you get funny behaviour!

sudo npm cache clean -f
sudo npm install -g n
sudo n stable

The last line can also be

sudo n <desired version>

I have done this with success

Upvotes: 3

Related Questions