How to Completely Uninstall Nodejs, and Reinstall From Scratch on Mac OS X?


To completely uninstall Nodejs and reinstall it from scratch on Mac OS X, follow these steps:

  1. Open the Terminal application.

  2. Run the command below to uninstall Nodejs:

    sudo rm -rf /usr/local/{lib/node{,/.npm,_modules},bin,share/man}/npm*

    This command will remove all Nodejs-related files and directories.

  3. Run the command below to remove any remaining Nodejs-related files:

    sudo rm -rf /usr/local/bin/node /usr/local/include/node /usr/local/lib/node_modules

  4. Close the Terminal application.

  5. Download the Node.js package from the official Nodejs website (

  6. Open the downloaded package and follow the installation instructions.

  7. Verify that Nodejs has been installed correctly by running the command below in the Terminal application:

    node -v

    This command should output the version of Nodejs that you just installed.

Congratulations! You have successfully uninstalled and reinstalled Nodejs from scratch on your Mac OS X computer.

Latest Questions

javascript How to resolve "SecurityError: Blocked a frame with origin from accessing a cross-origin frame" in javascript? javascript How to set the value of an input field in Javascript? javascript How to get the current URL using jQuery?