How to completely uninstall node and npm on mac

How to completely uninstall node and npm on mac

npm uninstall

 sudo npm uninstall npm -g

If you encounter this sentence and cannot uninstall npm, don't worry, the blogger has other ways, hahaha, then read on. First, we need to enter the folder where npm is located.

cd /usr/local/lib/node_modules/npm

Next we execute it under the npm file

sudo make uninstall

Next, if we see this interface, it means that we have successfully uninstalled

insert image description here

Test with npm -v . If it shows not found, it means the uninstallation was successful.

insert image description here

Node.js uninstall

 sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
 sudo rm -rf /usr/local/include/node /Users/$USER/.npm 
 sudo rm /usr/local/bin/node 
 sudo rm /usr/local/share/man/man1/node.1
 sudo rm /usr/local/lib/dtrace/node.d

Verify success

If you have executed the above code in order, we need to verify whether we have deleted it successfully.

If the following result appears, it means that we have deleted it successfully.

The same verification method, node -v displays the following interface, indicating that our uninstallation is successful

insert image description here

nodejs npm reinstall

Re-download from the official website

https://nodejs.org/en/download/current/

References:

How to uninstall node on Mac: https://zhuanlan.zhihu.com/p/41795892

The above is the details of completely uninstalling node and npm and reinstalling them on Python programming mac. For more information about completely uninstalling node and reinstalling npm on mac, please pay attention to other related articles on 123WORDPRESS.COM!

You may also be interested in:
  • Node.js installation tutorial and detailed explanation of NPM package manager usage
  • How to completely uninstall node and npm on Mac
  • Detailed explanation of the process of uninstalling and installing Node.js and npm
  • How to uninstall npm global modules and modify the default installation directory

<<:  Use of Linux ifconfig command

>>:  Solution to the Chinese garbled code problem in the decompressed version of MYSQL

Recommend

Flash embedded in web pages and IE, FF, Maxthon compatibility issues

After going through a lot of hardships, I searched...

8 essential JavaScript code snippets for your project

Table of contents 1. Get the file extension 2. Co...

MySQL deduplication methods

MySQL deduplication methods 【Beginner】There are v...

MySQL data duplicate checking and deduplication implementation statements

There is a table user, and the fields are id, nic...

Detailed example of jQuery's chain programming style

The implementation principle of chain programming...

Nginx configuration to achieve multiple server load balancing

Nginx load balancing server: IP: 192.168.0.4 (Ngi...

Implementation of postcss-pxtorem mobile adaptation

Execute the command to install the plugin postcss...

Two methods of restoring MySQL data

1. Introduction Some time ago, there were a serie...

The difference between char, varchar and text field types in MySQL

In MySQL, fields of char, varchar, and text types...

Native js implements custom scroll bar component

This article example shares the specific code of ...

Methods and techniques for designing an interesting website (picture)

Have you ever encountered a situation where we hav...

MySQL transaction autocommit automatic commit operation

The default operating mode of MySQL is autocommit...

CSS -webkit-box-orient: vertical property lost after compilation

1. Cause The requirement is to display two lines,...

How many ports can a Linux server open at most?

Table of contents Port-related concepts: Relation...

The rel attribute of the HTML link tag

The <link> tag defines the relationship bet...