Home >Web Front-end >JS Tutorial >How to Completely Uninstall Node.js and NVM on macOS and Reinstall Them Cleanly?
How to Completely Uninstall Node.js and NVM and Reinstall from Scratch (Mac OS X)
Problem:
Despite installing Node.js and NVM (Node Version Manager), the Node.js version remains stuck at v0.6.1-pre, even after updating it.
Background:
On Mac OS X, Node.js and related files are typically stored in the following locations:
Solution:
Uninstall Node.js:
Manually delete the following files and directories:
Run the following command:
brew uninstall node
Uninstall NVM:
Delete Local Folders:
Reinstall Node.js and NVM:
If necessary, reinstall npm using:
npm install -g npm
Additional Steps (Optional):
Run the following command to remove any remaining Node.js or npm files:
sudo rm -rf /opt/local/bin/node /opt/local/include/node /opt/local/lib/node_modules sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node.1 /usr/local/lib/dtrace/node.d
By following these steps, you can completely uninstall Node.js, NVM, and related files, and reinstall the entire system from scratch.
The above is the detailed content of How to Completely Uninstall Node.js and NVM on macOS and Reinstall Them Cleanly?. For more information, please follow other related articles on the PHP Chinese website!