Linux server quick uninstall and install node environment (easy to get started)

Linux server quick uninstall and install node environment (easy to get started)

1. Uninstall npm first

sudo npm uninstall npm -g

2. Uninstall node

yum remove nodejs npm -y

See if there is any residue

Go to /usr/local/lib and delete all node and node_modules folders

Go to /usr/local/include and delete all node and node_modules folders

Enter /usr/local/bin and delete the executable file of node

3. Install node

download:

 wget https://cdn.npm.taobao.org/dist/node/v12.13.1/node-v12.13.1-linux-x64.tar.xz

Unzip:

 xz -d node-v12.13.1-linux-x64.tar.xz
 tar -xvf node-v12.13.1-linux-x64.tar

Move to the local directory:

mv node-v12.13.1-linux-x64 /usr/local/

Rename:

mv /usr/local/node-v12.13.1-linux-x64/ /usr/local/node

Add environment configuration:

vim /etc/profile

Add the following content to the end of the file:

export NODE_HOME=/usr/local/node
export PATH=$NODE_HOME/bin:$PATH

Execute source to make the environment variables effective immediately.

source /etc/profile

Check the version and complete the installation as follows.

node -v

Can output version information, that is, ok

npm -v

Can output version information, that is, ok

This is the end of this article about how to quickly uninstall and install the node environment on a Linux server (easy to get started). For more information about how to uninstall and install node on Linux, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • How to solve the problem that Linux cannot install and uninstall Node.js normally

<<:  MySQL column to row conversion, method of merging fields (must read)

>>:  How to deal with too many Docker logs causing the disk to fill up

Recommend

Advantages and Problems of XHTML CSS Website Design

XHTML is the standard website design language cur...

Example code for implementing WeChat account splitting with Nodejs

The company's business scenario requires the ...

A brief discussion on the understanding of TypeScript index signatures

Table of contents 1. What is an index signature? ...

Detailed explanation of JQuery selector

Table of contents Basic selectors: Level selector...

Docker container data volume named mount and anonymous mount issues

Table of contents What is a container data volume...

How to use the Linux more command in Linux common commands

more is one of our most commonly used tools. The ...

How to store text and pictures in MySQL

Large Text Data Types in Oracle Clob long text ty...

Steps for packaging and configuring SVG components in Vue projects

I just joined a new company recently. After getti...

Implementation example of video player based on Vue

When the existing video player cannot meet the ne...

Regular expression usage in CSS selectors

Yes, CSS has regular expressions too (Amen) Two p...

How to use multi-core CPU to speed up your Linux commands (GNU Parallel)

Have you ever had the need to compute a very larg...

CentOS 7.6 installation of MySQL 5.7 GA version tutorial diagram

Table of contents Environment Preparation Environ...

Tutorial on Installing Nginx-RTMP Streaming Server on Ubuntu 14

1. RTMP RTMP streaming protocol is a real-time au...

Front-end JavaScript operation principle

Table of contents 1. What is a JavaScript engine?...