How to Install NodeJS on Debian 9 Stretch Linux -

NodeJS is on the rise, big time. It's one of the top web development tools, and when paired with the Express framework, it's solid direct competition to the likes of PHP and Ruby on Rails. Debian provides NodeJS in its repositories, but it's usually extremely out-of-date. There's no need to worry. The NodeJS Foundation recommends a Debian repository hosted by a popular NodeJS hosting service.
This is a companion discussion topic for the original entry at


Dave Látal

I have installed nodejs build-essential libssl-dev and other but npm still doesnt work - bash: command npm not found … :frowning:



Current Node LTS version is 8.9.3. The command in this article installs version 6.

Link to installation instructions for Debian based distros.

curl -sL | sudo -E bash -



node -v
bash: node: command not found

what do i do???


impressionant santhosh

I tried installing with sudo:

$ curl -sL | sudo -E bash -

But it threw an error:

## Confirming "stretch" is supported...
+ curl -sLf -o /dev/null '

## Adding the NodeSource signing key to your keyring...

 + curl -s | apt-key add -
 gpg: WARNING: nothing exported
 gpg: no valid OpenPGP data found.
 gpg: Total number processed: 0
 Error executing command, exiting



without sudo

$ curl -sL

shoud be

$ curl -sL > setup_6.x


# lsb_release -c -s

must return the distro name,


# apt-get install lsb-release