doom
doom

Reputation: 3608

How to install lastest version of Node and NPM for Linux Debian?

I have a Debian Jessie and latest Node version available with apt is 8.9.0.

What's the easy way to install the latest version aka 11.3.0 ? (and the latest NPM also)

Upvotes: 0

Views: 400

Answers (2)

ponury-kostek
ponury-kostek

Reputation: 8060

I think easiest way to manage Node.js versions is to use n

Installation

$ curl -L https://git.io/n-install | bash

Usage

$ n 11.3.0 #Install node 11.3.0 version
$ n latest #Install or activate the latest node release
$ n stable #Install or activate the latest stable node release

Upvotes: 1

doom
doom

Reputation: 3608

The easier way seems to be :

INSTALLATION

  1. Go to https://nodejs.org/en/download/current/ and copy url of your architecture Linux binaries (here Linux Binaries x64)
  2. Install xz-utils if needed : sudo apt-get install xz-utils
  3. write these commands

commands :

wget https://nodejs.org/dist/v11.3.0/node-v11.3.0-linux-x64.tar.xz
unxz node-v11.3.0-linux-x64.tar.xz
sudo tar --directory /usr/local --strip-components 1 -xf node-v11.3.0-linux-x64.tar
rm node-v11.3.0-linux-x64.tar

It should untar the archive in /usr/local which is already in the PATH and secure_path.


TEST

node -v return v11.3.0

npm -v return 6.4.1


UPDATE

To update, just make the same with new version and update NPM packages with npm update (not tested yet).

Upvotes: 0

Related Questions