Install nodejs ubuntu: 3 ways to install nodejs and npm

     

Node.js is a JavaScript runtime built on Chrome’s V8 JavaScript engine. Node.js can be installed in multiple ways on your Ubuntu Linux machine. You can use Ubuntu’s official repository lớn install Node.js or another way to use NodeSource repository. Installation via NodeSource repository will allow you to lớn choose latest version of Node.js.

Bạn đang xem: Install nodejs ubuntu: 3 ways to install nodejs and npm

Installing Node On Ubuntu 18.04 và 16.04: There are two methods Ubuntu official repository và NodeSouce repository khổng lồ install Node.js on Ubuntu.


Install Node.js using Ubuntu official repository: Node.js is available in Ubuntu’s repository và you can easily install it using a few commands. Follow the steps below to install Node.js on your Ubuntu operating system.

Step 1: xuất hiện your terminal or press Ctrl + alternative text + T.terminalStep 2: lớn install node.js use the following command:

sudo apt install nodejs


installStep 3: Once installed, verify it by checking the installed version using the following command:node -v or node –version

versionNote: It is recommended to lớn install Node Package Manager(NPM) with Node.js. NPM is an open source library of Node.js packages.To install NPM, use the following commands:

sudo apt install npmnpm -v or npm –version

Node và NPM will be successfully installed on your Ubuntu machine.

Xem thêm: Chạy File Iso Trên Win 10 - 3 Cách Mount File Iso Trên Windows 10

Install Node.js using NodeSouce repository: The latest version of Node.js can be installed from NodeSource repository. Follow the steps below lớn install the Node.js on your Ubuntu.

Step 1: xuất hiện your terminal or press Ctrl + alt + T và use the following commands lớn update and upgrade the package manager:

sudo apt-get updatesudo apt-get upgrade

Step 2: Install Python software libraries using the following command:sudo apt-get install python-software-properties

Step 3: địa chỉ cửa hàng Node.js PPA to the system.curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash –

Note: Here, we are installing node.js version 10, if you want to install version 11, you can replace setup_10.x with setup_11.x.Step 4: To Install Node.js & NPM to lớn your Ubuntu machine, use the command given below:sudo apt-get install nodejs

Step 5: Once installed, verify it by checking the installed version using the following command:node -v or node –versionnpm -v or npm –version

Finally, you have successfully installed Node.js and NPM on your Ubuntu machine.


Chuyên mục: Domain Hosting