Deepak Sharma
Deepak Sharma

Reputation: 5

I have install nodejs but version is old

Reading package lists... Done Building dependency tree
Reading state information... Done nodejs is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded. W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages) W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages) W: You may want to run apt-get update to correct these problems node-01@node01-desktop ~ $ node -v v0.10.37 node-01@node01-desktop ~ $ npm -v 1.4.28

Upvotes: 0

Views: 725

Answers (2)

Sridhar
Sridhar

Reputation: 11786

You can use Node Version Manager script to install and manage multiple versions of nodejs.

First, you need to install it on your system.

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

This will download and install the script. Once the installation is over, do a

nvm ls-remote

This will list all the version of nodejs that is available for use.

...
    v8.8.1
    v8.9.0   (LTS: Carbon)
    v8.9.1   (LTS: Carbon)
    v8.9.2   (LTS: Carbon)
    v8.9.3   (LTS: Carbon)
    v8.9.4   (Latest LTS: Carbon)
    v9.0.0
    v9.1.0
    v9.2.0
    v9.2.1
    v9.3.0
    v9.4.0
...

It is recommended to use the recent LTS, so we need to use v8.9.4 (Latest LTS: Carbon).

nvm install v8.9.4

Upvotes: 1

user9216855
user9216855

Reputation:

I can recommend the Node Version Manager. https://github.com/creationix/nvm

Just follow the instructions and there you go. Now you can install node.js version 9.40 like:

nvm install 9.4.0

and it will be automatically set to standard.

Upvotes: 0

Related Questions