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

Methods for defragmenting and reclaiming space in MySQL tables

Table of contents Causes of MySQL Table Fragmenta...

Summary of MySql storage engine and index related knowledge

Storage Engine What is a database storage engine?...

Tomcat Nginx Redis session sharing process diagram

1. Preparation Middleware: Tomcat, Redis, Nginx J...

Example of adding multi-language function to Vue background management

Table of contents 1. First, configure the main.js...

XHTML tags have a closing tag

<br />Original link: http://www.dudo.org/art...

How to configure static network connection in Linux

Configuring network connectivity for Linux system...

React Router V6 Updates

Table of contents ReactRouterV6 Changes 1. <Sw...

jQuery implements form validation

Use jQuery to implement form validation, for your...

Sharing of experience on repairing MySQL innodb exceptions

A set of MySQL libraries for testing. The previou...

Summary of using MySQL isolation columns and prefix indexes

Table of contents Isolate Data Columns Prefix Ind...

Methods of adaptive web design (good access experience on mobile phones)

1. Add the viewport tag to the HTML header. At th...

How to use Docker to build OpenLDAP+phpLDAPadmin unified user authentication

1. Background Use LDAP to centrally manage operat...

Bug of Chinese input garbled characters in flex program Firefox

Chinese characters cannot be input in lower versio...

Using keras to judge SQL injection attacks (example explanation)

This article uses the deep learning framework ker...