How to upgrade Node js version to 0.12.4 on Ubuntu

24.7k views Asked by At

I want to upgrade Node JS version on Ubuntu.

I tried many commands but its version is still the older i.e v0.10.37.

I tried:

sudo npm install -g n
sudo n install 0.12.4
sudo n use 0.12.4

Also tried with nvm but non of them works for me. How can I upgrade Node Js version to 0.12.4?

6

There are 6 answers

6
Pierre Inglebert On

The official doc from nodejs repository points to this : https://nodesource.com/blog/nodejs-v012-iojs-and-the-nodesource-linux-repositories#installing-node-js-v0-12

Just follow it and you'll have the 0.12.4.

1
user5539127 On

Execute following comand to upgrade nodejs to 0.12.x

Note the new setup script name for Node.js v0.12

curl -sL https://deb.nodesource.com/setup_0.12 | sudo bash -

Then install with:

sudo apt-get install -y nodejs

Just ignore warning. By executing both commands it worked for me on Ubuntu 14.04

2
Sravan On

Use npm in order to upgrade node

First Clean the cache and try

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

Then create a symbolic link(It is needed only sometimes, first try with these three commands. If it doesnot work add this.)

It will be updated to 0.12.4 Version.

0
jlerma On

Try running this in terminal:

nvm install 5.10.1
nvm use 5.10.1

The version may be change.

Cheers!

2
oleh.meleshko On

It could be enough just to install n module:

sudo npm install -g n

and then simply run:

sudo n 0.12.4

The trick is that it may not be updated in your current terminal session. So you can simply open one more tab in your terminal or just another terminal and check your nodejs version by:

node --version

That's it, output will be v0.12.4

0
Francesco On

On Ubuntu 16.04

There is no special or dedicated comand to upgrade node version. The correct way to install or upgrade node on ubuntu is:

1) download the distribution you wish from nodejs official site, move the file into a known path

2) open a terminal and run: >sudo tar -C /usr/local --strip-components 1 -xzf "known path/name_of_the_distribution_file...gz

3) test if everything is ok: open a new terminal and run node --version. It should echo the version you downloaded and installed/upgraded.