Linux completely removes node.js and reinstalls it through the yum command

Linux completely removes node.js and reinstalls it through the yum command

first step

Delete it once with the built-in package management

	yum remove nodejs npm -y

Manually delete the leftovers

  • 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

Install the latest xz package from nodejs official website

	# Download wget https://nodejs.org/dist/v10.13.0/node-v10.13.0-linux-x64.tar.xz
	
	# Unzip xz -d node-v9.8.0-linux-x64.tar.xz
	tar -xvf node-v9.8.0-linux-x64.tar
	
	# Enter the directory cd node-v10.13.0-linux-x64/
	
	# Create a soft link ln -s /opt/nodejs/node-v10.13.0-linux-x64/bin/node /usr/local/bin/node
	ln -s /opt/nodejs/node-v10.13.0-linux-x64/bin/npm /usr/local/bin/npm
	
	# Test node -v
	npm -v
	
	# Configure taobao image npm config set registry https://registry.npm.taobao.org

The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM.

You may also be interested in:
  • How to install node.js development environment in Linux
  • How to Install Node.js on Linux
  • Install node.js in linux using package manager

<<:  Solution to MySQL connection exception and error 10061

>>:  The way to represent colors in HTML is by using 6-digit hexadecimal codes, RGB or keywords.

Recommend

Comprehensive summary of mysql functions

Table of contents 1. Commonly used string functio...

Create a screen recording function with JS

OBS studio is cool, but JavaScript is cooler. Now...

How to customize more beautiful link prompt effect with CSS

Suggestion: Handwriting code as much as possible c...

vue perfectly realizes el-table column width adaptation

Table of contents background Technical Solution S...

Summary of MySql index, lock, and transaction knowledge points

This article summarizes the knowledge points of M...

MySQL5.6.31 winx64.zip installation and configuration tutorial

#1. Download # #2. Unzip to local and modify nece...

Unity connects to MySQL and reads table data implementation code

The table is as follows: Code when Unity reads an...

Example of using CSS to achieve floating effect when mouse moves over card

principle Set a shadow on the element when hoveri...

MySQL FAQ series: When to use temporary tables

Introduction to temporary tables What is a tempor...

Docker cleaning killer/Docker overlay file takes up too much disk space

[Looking at all the migration files on the Intern...

Native JS to achieve directory scrolling effects

Here is a text scrolling effect implemented with ...

How to set up a deployment project under Linux system

1. Modify the firewall settings and open the corr...