How to manually upgrade the node version under CentOs

How to manually upgrade the node version under CentOs

1. Find the corresponding nodejs package, refer to https://nodejs.org/download/release/

2. Switch to the location where node is installed, which is /usr/local/lib/nodejs

No existence can be established

mkdir /usr/local/lib/nodejs

3. Download

wget node-v8.12.0-linux-x64.tar.xz

4. Unzip

 tar -xJvf node-8.12.0-linux-x64.tar.xz -C /usr/local/lib/nodejs 
 mv /usr/local/lib/nodejs/node-8.12.0-linux /usr/local/lib/nodejs/node-8.12.0

5. Configure environment variables

vim ~/.profile

Enter the following

 export NODEJS_HOME=/usr/local/lib/nodejs/node-8.12.0/bin
 export PATH=$NODEJS_HOME:$PATH

6. Refresh environment variables immediately

~/.profile

7. Detection version

node -v

8. Establish system links to simplify calls

 sudo ln -s /usr/local/lib/nodejs/node-8.12.0/bin/node /usr/bin/node
 sudo ln -s /usr/local/lib/nodejs/node-8.12.0/bin/npm /usr/bin/npm
 sudo ln -s /usr/local/lib/nodejs/node-8.12.0/bin/npx /usr/bin/npx

Summarize

The above is the method of manually upgrading the node version under CentOs introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Detailed explanation of online deployment of NodeJs project CentOs linux server
  • How to install NodeJS V8.0.0 on CentOS
  • Node.js installation tutorial under Centos6.8
  • Steps to deploy nodejs on Centos
  • Nodejs script centos startup practical method

<<:  7 interview questions about JS this, how many can you answer correctly

>>:  Simple implementation of Mysql add, delete, modify and query statements

Recommend

Analysis of the advantages of path.join() in Node.js

You might be wondering why you should use the pat...

Docker installs mysql and solves the Chinese garbled problem

Table of contents 1. Pull the mysql image 2. Chec...

JavaScript implementation of verification code case

This article shares the specific code for JavaScr...

How to install Chrome browser on CentOS 7

This article introduces how to install Chrome bro...

Mysql NULL caused the pit

Using NULL in comparison operators mysql> sele...

VS2019 connects to mysql8.0 database tutorial with pictures and text

1. First, prepare VS2019 and MySQL database. Both...

Basic HTML directory problem (difference between relative path and absolute path)

Relative path - a directory path established based...

In-depth understanding of the use of the infer keyword in typescript

Table of contents infer Case: Deepen your underst...

Detailed explanation of HTML form elements (Part 2)

HTML Input Attributes The value attribute The val...

Detailed explanation of how to use the vue verification code component

This article example shares the specific implemen...

Implementation of postcss-pxtorem mobile adaptation

Execute the command to install the plugin postcss...

MySQL series tutorials for beginners

Table of contents 1. Basic concepts and basic com...

Vue+el-table realizes merging cells

This article example shares the specific code of ...

Methods and steps for deploying GitLab environment based on Docker

Note: It is recommended that the virtual machine ...