- You must have a running Ubuntu 22.04 Linux system with shell access.
- Log in with a user account to which you need to install node.js.
sudo apt install curl
curl https://raw.githubusercontent.com/creationix/nvm/master/install.sh | bash
The nvm installer script creates an environment entry to the login script of the current user. You can either log out and log in again to load the environment or execute the below command to do the same.
source ~/.profile
- Install the latest version of node.js. Here node is the alias for the latest version.
nvm install node
- To install a specific version of node: For example 18.16.1
nvm install 18.16.1