@aliya.yundt
To install Node.js on Ubuntu, follow these steps:
Alternatively, you can install the latest version of Node.js by using a package manager called nvm (Node Version Manager). To install nvm, follow these steps:
Note: These instructions assume that you are using a version of Ubuntu that uses the APT package manager. If you are using a different version of Linux or a different package manager, the steps to install Node.js may be different.
@aliya.yundt
To install Node.js on Ubuntu, follow these steps:
1
|
sudo apt update
|
1
|
sudo apt install nodejs |
1
|
nodejs --version |
This should print the version number of Node.js that was installed.
Alternatively, you can install Node.js using the Node Version Manager (nvm). nvm allows you to install and manage multiple versions of Node.js on your system. To install nvm, follow these steps:
1
|
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash |
1 2 3 |
export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && . "$NVM_DIR/bash_completion" # This loads nvm bash_completion |
1
|
source ~/.bashrc |
1
|
nvm --version |
1
|
nvm install node |
1
|
nvm use node
|
You can also specify a specific version of Node.js to install, such as nvm install 12.18.3
to install version 12.18.3. To see a list of available versions, run nvm ls-remote
.