How to Install Node.js and NVM
Node.js is a JavaScript runtime built on Chrome's V8 JavaScript engine. It allows developers to run JavaScript on the server-side. NVM (Node Version Manager) is a tool that allows you to manage multiple versions of Node.js.
Installing NVM
Open your terminal or command prompt.
Install NVM by running the following command:
curl -O <https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh> | bash
Alternatively, you can install NVM using the wget command:
wget -qO- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh> | bash
Verify that NVM has been installed correctly by running:
nvm --version
Installing Node.js
Open your terminal or command prompt.
Install the latest version of Node.js by running the following command:
nvm install node
If you want to install a specific version of Node.js, you can run:
nvm install {version number}
For example, to install Node.js version 14.17.0, you would run:
nvm install 14.17.0
Verify that Node.js has been installed correctly by running:
node --version
Congratulations! You have successfully installed Node.js and NVM on your system.