How to install the latest version of node on Ubuntu?

I want to install the latest version of node (v6.2.0 at the time of writing) on ​​Ubuntu. But since I do

sudo apt-get nodejs

Installed v0.10.37.

Could you help me in installing the latest version of node js as well as the latest version of npm?

+4
source share
10 answers

It's very simple. Take the Linux node distribution from here: https://nodejs.org/dist/v6.2.0/

Open a terminal and enter the command below:

sudo tar -C /usr/local --strip-components 1 -xzf ~/Downloads/node-v6.2.0-linux-x64.tar.gz

ls -l /usr/local/bin/node

That's all.

Now check the node version by typing:

node -v
npm -v

In Ubuntu, you can install any version of node using the above steps.

+9
source

official instruction :

curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs

https://deb.nodesource.com/setup_6.x, script .
, , sudo.

+5

node node aka nvm, , run

nvm install 6.2.0
+2

Node.js Ubuntu Node (NVM). , node Ubuntu PPA , . NVM, tarballs . , node NVM:

1: NVM

:

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

2: node

NVM . :

nvm install node

3: node

:

node --version
npm --version

, node npm . , node ! 😊


. AskUbuntu " node.js?" . , , .

+1

,

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

sudo n latest

sudo n stable
+1

, nodejs , LTS , PPA

LTS

apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -
apt-get install nodejs

apt-get install curl python-software-properties
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
apt-get install nodejs

: https://codesposts.com/ydOAwynW

+1

Node.js , ,

12.x :

  1. [Ctrl + Alt + t]

Ubuntu

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

Debian root

curl -sL https://deb.nodesource.com/setup_12.x | bash -
apt-get install -y nodejs
+1
sudo apt-get update && sudo apt-get upgrade && sudo apt-get install -y nano git curl vim htop gnupg2 && curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash - && sudo apt-get install -y nodejs
0

I would suggest installing through the package manager to make sure it is installed with exact dependencies.

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs

Also use NPM

 sudo apt-get install npm

to install the modules, like this:

npm install express
0
source

All Articles