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

Practical example of nested routes in vue.js Router

Table of contents Preface Setting up with Vue CLI...

40 CSS/JS style and functional technical processing

1- Styling dropdown select boxes - Modify the dro...

How to write transparent CSS for images using filters

How to write transparent CSS for images using filt...

Element Plus implements Affix

Table of contents 1. Component Introduction 2. So...

Vue.js implements timeline function

This article shares the specific code of Vue.js t...

Use jQuery to fix the invalid page anchor point problem under iframe

The application scenario is: the iframe page has n...

Use of MySQL query rewrite plugin

Query Rewrite Plugin As of MySQL 5.7.6, MySQL Ser...

MySQL dual-master (master-master) architecture configuration solution

In enterprises, database high availability has al...