
Then, verify the version of the installed Node.js: For instance, we will install Node.js “ v17.1.0” using the following command: $ nvm install v17.1.0 $ nvm list-remote Step 3: Install and verify the preferred version of Node.jsĬhoose your desired version and install it on your machine. bashrc file and check the version list using the below-mentioned commands: $ source ~/.bashrc bashrc file and get list of versionsĪfter installing the nvm script on the system, source the.

Then, use below mentioned command to run the nvm installer: $ curl | bash Step 2: Source. Make sure curl should be installed on the machine to get the script of the nvm installer: $ sudo apt install curl Step 1: Install curl and get nvm scriptįirstly, to install curl, you can use the “apt install curl” command. NVM displays all available versions in the form of a list, and the user can choose the latest version of Node.js to install on the machine.įollowing are the steps to install Node.js using the nvm repository.

It allows us to install different versions of Node.js at one time, and the user can also switch between them at runtime. Next, utilize the following command to install the desired version of Node.js on Ubuntu 22.04: $ sudo apt install nodejsĪfter successful installation of Node.js, verify the installed version with the help of the following command: $ node -v Installation of Nodejs using NVM repository In the second step, we will update the system repository: $ sudo apt update Step 3: Installation and verification of Node.js version You can replace “ 16.x” with your selected Node.js version. For now, we prefer to install the Node.js “ 16.x”: $ curl -sL | sudo -E bash. Step 1: Get installation script to install Node.jsįirstly, use the curl command to get the script to install the preferred version. To do so, follow the below-given step-by-step procedure. You can also utilize the PPA (personal package archive) repository to install a specific version of Node.js according to user preference. In the third step, we need to verify the installation of Node.js by executing the following command: $ node -v Installation of Nodejs using PPA repository Enter “ y” to permit the process to continue: Step 3: Verify the version of Node.js It will ask for confirmation to continue installation after running the install command.

In the next step, we will execute the below-given command for Node.js installation on our Ubuntu 22.04 system: $ sudo apt install nodejs Firstly, open up your Ubuntu 22.04 terminal by pressing “ CTRL+ALT+T” and then update the repository: $ sudo apt update Step 2: Installing Node.js
