Velvet Star Monitor

Standout celebrity highlights with iconic style.

updates

Cannot install latest stable nodejs after node 6 was installed

Writer Sophia Terry

I tried to upgrade node 6.x to latest stable. I tried few methods with apt-get, nvm, npm and nothing helped.

Why I cannot get latest stable node on Ubuntu 16.04 as simple as:

sudo apt-get update
sudo apt-get install nodejs

How can I get latest stable node on Ubuntu 16.04?

here my terminal copy-paste:

pm@pm-node:~$ sudo apt-get update
Ign:1 stable InRelease
Get:2 xenial-security InRelease [102 kB]
Hit:3 xenial InRelease
Get:4 xenial-updates InRelease [102 kB]
Hit:5 stable InRelease
Get:6 xenial-backports InRelease [102 kB]
Hit:7 stable Release
Hit:8 xenial InRelease
Get:9 xenial-updates/main amd64 DEP-11 Metadata [317 kB]
Get:10 xenial-updates/main DEP-11 64x64 Icons [226 kB]
Get:12 xenial-updates/universe amd64 DEP-11 Metadata [190 kB]
Get:13 xenial-updates/universe DEP-11 64x64 Icons [266 kB]
Get:14 xenial-updates/multiverse amd64 DEP-11 Metadata [5 888 B]
Get:15 xenial-backports/main amd64 DEP-11 Metadata [3 328 B]
Get:16 xenial-backports/universe amd64 Packages [7 084 B]
Get:17 xenial-backports/universe i386 Packages [7 060 B]
Get:18 xenial-backports/universe amd64 DEP-11 Metadata [4 696 B]
Fetched 1 334 kB in 2s (535 kB/s)
Reading package lists... Done
pm@pm-node:~$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed: nodejs
0 upgraded, 1 newly installed, 0 to remove and 173 not upgraded.
Need to get 0 B/12,7 MB of archives.
After this operation, 61,3 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 221467 files and directories currently installed.)
Preparing to unpack .../nodejs_8.10.0-1nodesource1_amd64.deb ...
Unpacking nodejs (8.10.0-1nodesource1) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up nodejs (8.10.0-1nodesource1) ...
pm@pm-node:~$ node -version
bash: /home/pm/.nvm/versions/node/v6.11.4/bin/node: No such file or directory
pm@pm-node:~$ node --version
bash: /home/pm/.nvm/versions/node/v6.11.4/bin/node: No such file or directory
pm@pm-node:~$ 

1 Answer

sudo apt-get install python-software-properties
curl -sL | sudo -E bash -

The PPA will be added. After this install.

sudo apt-get install nodejs

To check your version try this nodejs -v.

You should see an output like: v8.10.0

You may want this too:

sudo apt-get install build-essential

Best of luck.


I've just tried my instructions on debian raspberry pi and result is:

pi@192:/ $ nodejs -v
v8.10.0
pi@192:/ $ npm -v
5.6.0
3

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy