Install node on Tencent cloud server

Our goal is to build our own web application, so let's take a look at the installation tutorial of the main tools used.

Today I'm going to talk about node installation.

A brief introduction to node.

  1. Basic concept: Node is an open source JavaScript-based server-side and client-side JavaScript runtime environment, which can run JavaScript in the browser or on the server side.
  2. Features: Node has the characteristics of high performance, scalability, flexibility, and ease of use. It can run on multiple operating systems, such as Windows, Mac OS, Linux, etc., and supports multiple programming languages, such as JavaScript, TypeScript, ECMAScript, etc.
  3. Purpose: Node is mainly used to develop server-side applications and client-side applications, such as web applications, mobile applications, desktop applications, etc. It can be used to develop games, mobile applications, IoT, and more.

Open our cloud service, if you don’t know the basic settings, you can read my last article: Tencent Cloud Server Xiaobai Nanny Level Tutorial_Dapeng bmfm Blog-CSDN Blog

Common liniux commands:

View the current directory: pwd

[root@VM-0-5-opencloudos ~]# pwd

/root

Open folder: cd + filename

Create a new folder: mkdir + folder name

1. Open a folder, whichever folder you want to install, just put it there.

The opt folder is selected here

[root@VM-0-5-opencloudos ~]# cd /opt

2. Enter the command to download node directly.

ps: You don’t need to care too much about the version here, because we will talk about cloud server upgrade node later

wget https://npm.taobao.org/mirrors/node/v10.13.0/node-v10.13.0-linux-x64.tar.xz 

Just swipe and swipe, and the download is over, isn’t it very technological?

3. Unzip the downloaded file

tar -xvf node-v10.13.0-linux-x64.tar.xz 

still brush

4. View the installation file

5. Configure environment variables

After the installation is successful, it cannot be used yet, and it needs to be configured

ln -s /opt/node-v10.13.0-linux-x64/bin/node /usr/local/bin/
ln -s /opt/node-v10.13.0-linux-x64/bin/npm /usr/local/bin/

Note that the first position in each line of command is where you installed node. I installed it in /opt

View location command:

pwd

6. Verify usage

Check node version

node  -v

If it shows like this, you can use it

Follow-up will talk about upgrading node to the latest version, please continue to pay attention.

Guess you like

Origin blog.csdn.net/sunzongpeng/article/details/130024250