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

Example of MySQL auto-increment ID exhaustion

Display Definition ID When the auto-increment ID ...

Solutions to the Problem of Creating XHTML and CSS Web Pages

The solutions to the problems encountered during x...

How to run nginx in Docker and mount the local directory into the image

1 Pull the image from hup docker pull nginx 2 Cre...

Three properties of javascript objects

Table of contents 1. writable: writable 2. enumer...

MySQL query statement simple operation example

This article uses examples to illustrate the simp...

MySQL uses aggregate functions to query a single table

Aggregate functions Acts on a set of data and ret...

About the location of the H1 tag in XHTML

There has been a lot of discussion about H1 recent...

Detailed installation process of MySQL5.6.40 under CentOS7 64

MySQL5.6.40 installation process under CentOS7 64...

Some ways to eliminate duplicate rows in MySQL

SQL statement /* Some methods of eliminating dupl...

Docker creates MySQL explanation

1. Download MySQL Image Command: docker pull mysq...

What kinds of MYSQL connection queries do you know?

Preface If the query information comes from multi...

How to use the markdown editor component in Vue3

Table of contents Install Importing components Ba...