How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X)?
ยท
194 words
ยท
1 minute read
uninstall Node.js ๐
There is a /Users/myusername/local
folder that contained a include
with node
and lib
with node
and node_modules
. Deleting these local references.
Run this command in your Terminal.
sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/{npm*,node*,man1/node*}
Or use this command.
sudo rm -rf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp
or do those steps instead.
To completely uninstall node + npm is to do the following:
- go to
/usr/local/lib
and delete any node and node_modules - go to
/usr/local/include
and delete any node and node_modules directory - if you installed it with
brew install node
, then runbrew uninstall node
in your terminal - check your Home directory for any local or lib or include folders, and delete any node or node_modules from there such as
~/.npm
or~/.nvm
. - go to
/usr/local/bin
and delete any node executable
You may also need to do:
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
Additionally, NVM modifies the PATH variable in $HOME/.bashrc
or $HOME/.zshrc
, which must be reverted manually
.
reinstall Node.js ๐
download nvm and follow the instructions to install node. The latest versions of node come with npm, I believe, but you can also reinstall that as well.