How to Uninstall and Reinstall Node.js, npm, and NVM on Mac OS X
A user recently experienced a persistent outdated version of Node.js (v0.6.1-pre) despite installing newer versions. The investigation revealed a phantom node 0.6.1-pre version that persisted despite various uninstallation attempts.
Solution
The user identified a previously overlooked local folder under the user directory, which contained folders for include, lib, node, and node_modules. Deleting these local references resolved the issue.
Complete Uninstallation and Reinstallation
To completely uninstall Node.js, npm, and NVM and reinstall from scratch:
1. Remove Node.js
2. Additional Removal
Consider running the following commands as well:
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
3. Remove NVM
NVM modifies the PATH variable in $HOME/.bashrc; revert this manually.
4. Reinstallation
The above is the detailed content of How to Completely Uninstall and Reinstall Node.js, npm, and NVM on macOS?. For more information, please follow other related articles on the PHP Chinese website!