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:
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 -
Install Node.js using apt-get :
sudo apt-get install -y nodejs
Confirm Node.js version:
node -v
If you have an older version of Node.js installed , you need to remove it using the following command:
sudo apt-get remove nodejs
Install npm
sudo apt-get install npm
sudo npm install -g express mongoose request
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!