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

Steps to repair grub.cfg file corruption in Linux system

Table of contents 1. Introduction to grub.cfg fil...

Alibaba Cloud domain name and IP binding steps and methods

1 Enter the Alibaba Cloud console, find the domai...

Solve the problem of Nginx returning 404 after configuring proxy_pass

Table of contents 1. Troubleshooting and locating...

VMware and CentOS system installation method to reset the root password

Today's Tasks 1. Choice of Linux distribution...

Solution to SNMP4J server connection timeout problem

Our network management center serves as the manag...

Experience of redesigning the homepage of TOM.COM

<br />Without any warning, I saw news on cnB...

Introduction to /etc/my.cnf parameters in MySQL 5.7

Below are some common parameters of /etc/my.cnf o...

Native JavaScript implementation of progress bar

The specific code for JavaScript to implement the...

canvas.toDataURL image/png error handling method recommendation

Problem background: There is a requirement to tak...

Vue implements automatic jump to login page when token expires

The project was tested these days, and the tester...

Solve the problem of OpenLayers 3 loading vector map source

1. Vector Map Vector graphics use straight lines ...

In-depth study of vue2.x--Explanation of the h function

Table of contents Solution, Summarize: vue projec...

MySQL 8.0 WITH query details

Table of contents Learning about WITH queries in ...