node installation on ubuntu
In this document, we will discuss different options to install Node.js on Ubuntu.
Option 1: Install via NVM (Node Version Manager)
One way of installing Node.js on Ubuntu is by using NVM. Follow the steps below to install Node.js via NVM:
- Run the following command to download and install NVM:
$ curl -o- <https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh> | bash
- Once NVM is installed, run the following command to see the list of available Node.js versions:
$ nvm list-remote
- Choose the LTS (Long Term Support) version greater than 14 and install it using the following command:
$ nvm install <LTS version greater than 14>
Option 2: Install via apt-get
Another way of installing Node.js on Ubuntu is by using apt-get. Follow the steps below to install Node.js via apt-get:
- Update the apt package list:
$ sudo apt-get update
- Install Node.js using apt-get:
$ sudo apt-get install nodejs
- Verify that Node.js and npm (Node Package Manager) have been installed successfully:
$ node -v
$ npm -v
Option 3: Install via Node.js Website
Another way to install Node.js on Ubuntu is to download the installer from the official Node.js website. Follow the steps below to install Node.js via the website:
- Go to the Node.js website and download the LTS (Long Term Support) version for Ubuntu.
- Once the download is complete, navigate to the directory where the downloaded file is located and run the following command to extract the contents of the file:
$ tar -xvf <filename>.tar.gz
- Navigate to the extracted directory and run the following command to install Node.js:
$ sudo ./configure
$ sudo make
$ sudo make install
- Verify that Node.js and npm (Node Package Manager) have been installed successfully:
$ node -v
$ npm -v
Conclusion
We have discussed three options to install Node.js on Ubuntu. among them I personally feel that option 1 is more suitable and convenient one. if you are a developer and working on multiple versions of node then NVM is suitable. Option 2 is a simpler option but it may not prove a latest version. Option 3 is a bit complex one as it involves downloading and configuring source package.
I appreciate, cause I found just what I was looking for. You’ve
ended my 4 day lengthy hunt! God Bless you man. Have a nice
day. Bye https://Zeleniymis.Com.ua/
I appreciate, cause I found just what I was looking for.
You’ve ended my 4 day lengtghy hunt! God Bless you
man. Have a nice day. Bye https://Zeleniymis.Com.ua/