0

This question already has an answer here:

No matter how I try I end up with nodejs 4.2.6. Is it a joke?

$ nodejs -v
v4.2.6

Uninstall and 4.2.6 returns like a virus

$ sudo apt-get install nodejs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  gyp libjs-inherits libjs-node-uuid libjs-underscore libuv1-dev
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  nodejs
0 upgraded, 1 newly installed, 0 to remove and 73 not upgraded.
Need to get 0 B/3 161 kB of archives.
After this operation, 13,2 MB of additional disk space will be used.
Selecting previously unselected package nodejs.
(Reading database ... 434000 files and directories currently installed.)
Preparing to unpack .../nodejs_4.2.6~dfsg-1ubuntu4.1_amd64.deb ...
Unpacking nodejs (4.2.6~dfsg-1ubuntu4.1) ...
Processing triggers for doc-base (0.10.7) ...
Processing 1 added doc-base file...
Registering documents with scrollkeeper...
Processing triggers for man-db (2.7.5-1) ...
Setting up nodejs (4.2.6~dfsg-1ubuntu4.1) ...
update-alternatives: using /usr/bin/nodejs to provide /usr/bin/js (js) in auto mode

marked as duplicate by karel, Elder Geek, Kevin Bowen, waltinator, Zanna May 28 '18 at 17:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • You install nodejs 4.2.6 and you get nodejs 4.2.6. Not sure what's the problem. What do you expect to happen? – Sebastian Stark May 27 '18 at 10:23
  • If you are unhappy with the version of nodejs that Ubuntu 16.04 provides you will find a way to upgrade it here: askubuntu.com/questions/426750/… – Sebastian Stark May 27 '18 at 10:27
1

This happens because Ubuntu provides this version of node js by default. When I installed I got a similar version.

Then I followed this guide. I able to install latest versions. The best way is to download the binary from the official node site. Then extract the package and add it to a system path location.

Not the answer you're looking for? Browse other questions tagged or ask your own question.