0

I need to use the following versions for my script to properly continue working.

npm -v 5.8.0
node -v v9.10.1
nodejs -v v4.2.6

I have npm and node correct but I cannot get nodejs to use v4.2.6

nodejs -v v9.11.2
John Lang
  • 1
  • 1
  • 1
  • Related: [how to install latest version of nodejs in Ubuntu](https://askubuntu.com/q/929180/301745), [How can I update my nodeJS to the latest version?](https://askubuntu.com/questions/426750/how-can-i-update-my-nodejs-to-the-latest-version) – wjandrea Jun 23 '18 at 21:33
  • 2
    Possible duplicate of [How to install a Specific Version of Node on Ubuntu Server](https://askubuntu.com/questions/957439/how-to-install-a-specific-version-of-node-on-ubuntu-server) – KK Patel Jun 23 '18 at 22:31
  • 2
    Possible duplicate of [How to install nodejs specific version](https://askubuntu.com/questions/528266/how-to-install-nodejs-specific-version) – karel Jun 24 '18 at 02:09
  • Please follow below answer: https://askubuntu.com/questions/1178540/installing-current-nodejs-version/1279944#1279944 – Hemant Tripathi Oct 04 '20 at 13:13

1 Answers1

0

Use below commands:

sudo n list => show the list of installed versions sudo n stable => install latest stable version.

sudo n stable => install latest stable version

or sudo n (ex: sudo n 12.18.3) to install the specific version of nodejs

Additionally, you can also use nvm (especially in case of windows os, because above commands works on linux) to install or switch between node versions.