Node.js is a JavaScript runtime environment based on Chrome V8 engine. Official website address https://nodejs.org/en/
Its advantage lies in the use of an event-driven, non-blocking I/O model, asynchronous programming, making it lightweight and efficient.
Of course, the shortcomings are also obvious. Single-process, single-threaded, only supports single-core cpu, and cannot make full use of multi-core cpu servers.
The installation environment of this tutorial is
1、 Centos8 x86 minimal installation system-virtual machine, 8-core 16G memory 500G storage
Let's start the formal installation:
1、 Install node.js environment
Visit the official website to get the source code package of linux x64 https://nodejs.org/en/download/
cd /opt/
wget https://nodejs.org/dist/v12.16.1/node-v12.16.1-linux-x64.tar.xz
xz -d node-v12.16.1-linux-x64.tar.xz
tar -xf node-v12.16.1-linux-x64.tar
echo "export NODE_HOME=/opt/node-v12.16.1-linux-x64">>/etc/profile
echo "export PATH=\$NODE_HOME/bin:$PATH">>/etc/profile
source /etc/profile
rm -rf node-v12.16.1-linux-x64.tar
curl -sL https://rpm.nodesource.com/setup_12.x | bash -
yum install nodejs -y
Check version
node -v
npm -v
At this point, the nodejs installation is complete, and let's start using it.
Recommended Posts