How to install Node.js8 on Linux

PHPz
Release: 2023-05-15 14:55:06
forward
1374 people have browsed it

Node.js is an event-driven, non-blocking I/O model JavaScript runtime environment. It enables efficient web applications and server-side scripts.

In order to install Node.js 8, we need to complete the following steps:

  1. Install Node.js 8

We can Use NodeSource’s binary Linux distribution to install Node.js 8. Here are the installation steps:

  • Add Node.js PPA:

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
Copy after login
  • Install Node.js using apt-get :

sudo apt-get install -y nodejs
Copy after login
  • Confirm Node.js version:

node -v
Copy after login

If you have an older version of Node.js installed , you need to remove it using the following command:

sudo apt-get remove nodejs
Copy after login
  1. Install npm

##npm is the package manager for Node.js. To install npm, we can use the following command:

sudo apt-get install npm
Copy after login

  1. Install common npm packages

In Node.js, there are many commonly used npm packages Bag. Here are some commonly used npm packages:

  • express: a popular web application framework

  • mongoose: an object modeler for MongoDB

  • request: an HTTP request library

To install the above package, please use the following command:

sudo npm install -g express mongoose request
Copy after login

The above is the detailed content of How to install Node.js8 on Linux. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:yisu.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!