How to install node

      41

Node.js is an open-source, cross-platform JavaScript run-time environment that executes JavaScript code outside of a browser. Node.js lets developers use JavaScript to lớn write command-line tools and for server-side scripting—running scripts server-side to produce dynamic web page content before the page is sent khổng lồ the user"s web browser.

Bạn đang xem: How to install node

NPM is a package manager for the JavaScript programming language. It is the default package manager for the JavaScript runtime environment Node.js.

In this guide, we will explain how lớn install NodeJS và NPM on an Ubuntu 16.04/18.04 server.

Deploying your cloud server If you have not already registered with thietkewebhcm.com.vn, you should begin by getting signed up. Take a moment lớn create an account after which you can easily deploy your own cloud servers.

Xem thêm: Mã Md5 Dùng Để Làm Gì - Hướng Dẫn Kiểm Tra, Check Mã Md5

Once you have signed up, log into your thietkewebhcm.com.vn Client Area và deploy your thietkewebhcm.com.vn cloud server.

You can also view our guide on Installing NodeJS & NPM on CentOS 7

Step 1: địa chỉ cửa hàng Node.js APT Repository We will địa chỉ the most recent packages of Node.js which are available on an APT repository. First, update your system & install some dependencies.

sudo apt-get updatesudo apt-get -y install curl dirmngr apt-transport-https lsb-release ca-certificates vim

*

To kiểm tra the latest release, visit the Node.js Releases page

Add Node.js current repository: At the time of this guide, the latest version of the NodeJS current repository is 11.14.0. Issue the command below to add the Apt repository for that version:

curl -sL https://deb.nodesource.com/setup_11.x | sudo -E bash -

*

*

Add Node.js LTS repository For production purposes, the LTS release is recommended. At the time of this guide, this is Node.js 10.15.3 LTS. Issue the command below to add the Apt repository for that version:

curl -sL https://deb.nodesource.com/setup_10.x | sudo -E bash -Step 2: Install Node.js Next, proceed to install nodejs with the command below: sudo apt-get -y install nodejs

*

You can also proceed to lớn install development tools khổng lồ build native add-ons with the command below:

sudo apt-get install gcc g++ make

*
After successfully installing, you can confirm versions of nodejs with the command below:

node --versionnpm --version

*

Step 3: Install Yarn package manager This is optional but to lớn install the Yarn package manager, issue the command below:

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.listsudo apt-get update && sudo apt-get install yarn

*

Verify installation with the command below:

yarn --version

*

To learn more about NodeJS, you can read the official documentation for more information.

hotlive