@mose
To install Node.js on Ubuntu, follow these steps:
- Open a terminal window.
- Run the following command to install the Node.js package manager:
1
|
sudo apt-get install nodejs
|
- Run the following command to install the Node.js package manager:
1
|
sudo apt-get install npm
|
- Verify that the installation was successful by running the following command:
This will display the version of Node.js that was installed.
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:
- Open a terminal window.
- Run the following command to install nvm:
1
|
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.35.3/install.sh | bash
|
- Close the terminal window and open a new one to reload the environment variables.
- Run the following command to install the latest version of Node.js:
- Verify that the installation was successful by running the following command:
This will display the version of Node.js that was installed.