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

JS array loop method and efficiency analysis comparison

Array Methods JavaScript has provided many array ...

Solution to the problem that the Vue page image does not display

When making a new version of the configuration in...

How to implement gzip compression in nginx to improve website speed

Table of contents Why use gzip compression? nginx...

MySQL 5.7.12 installation and configuration tutorial under Mac OS 10.11

How to install and configure MySQL on Mac OS 10.1...

Rhit efficient visualization Nginx log viewing tool

Table of contents Introduction Install Display Fi...

In IIS 7.5, HTML supports the include function like SHTML (add module mapping)

When I first started, I found a lot of errors. In...

Vue complete code to implement single sign-on control

Here is a Vue single sign-on demo for your refere...

Websocket+Vuex implements a real-time chat software

Table of contents Preface 1. The effect is as sho...

Teach you MySQL query optimization analysis tutorial step by step

Preface MySQL is a relational database with stron...

Deploy Nginx+Flask+Mongo application using Docker

Nginx is used as the server, Mongo is used as the...

Navicat Premium operates MySQL database (executes sql statements)

1. Introduction to Navicat 1. What is Navicat? Na...

Detailed steps for installing and using vmware esxi6.5

Table of contents Introduction Architecture Advan...