To install Node.js on Linux, you can follow the steps below:
Update your package manager's repository information by running the following command:
sudo apt update
Install the required dependencies by executing the following command:
sudo apt install -y curl dirmngr apt-transport-https lsb-release ca-certificates
Import the Node.js signing key using the following command:
curl -sL https://deb.nodesource.com/setup_14.x | sudo -E bash -
Note: In this example, we're using version 14.x. You can replace "14.x" with the desired version number if needed. Check the official Node.js website for the latest version.
Once the key is imported, you can install Node.js by running the following command:
sudo apt install -y nodejs
To verify that Node.js and npm (Node Package Manager) are installed correctly, you can check their versions by executing the following commands:
node -v npm -v
If the installation was successful, you will see the versions of Node.js and npm displayed.
That's it! Node.js should now be installed on your Linux system.
Comments
Post a Comment