npm install not working in windows

After countless hours of debugging and researching, I decided to install in a different machine to see if the problem was with my Node installation. It worked.

So for everyone who may come across this, know that the possibility to uninstall node and delete NPM will be there. This is what I did. I believe it is the safest way to solve the problem and all the rest of your applications installed in your machine will still work. I credit this answer for these steps, although I had other npm and node_modules in other locations. So do a quick search for these and unless they are part of an application, make sure they are deleted as well.

  1. Uninstall from Programs & Features with the uninstaller.
  2. Reboot (or you probably can get away with killing all node-related processes from Task Manager).
  3. Look for these folders and remove them (and their contents) if any still exist. Depending on the version you installed, UAC settings, and CPU architecture, these may or may not exist:
    • C:\Program Files (x86)\Nodejs
    • C:\Program Files\Nodejs
    • C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
    • C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)
    • C:\Users\{User}\.npmrc (and possibly check for that without the . prefix too)
  4. Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.
  5. If it’s still not uninstalled, type where node at the command prompt and you’ll see where it resides — delete that (and probably the parent directory) too.
  6. Reboot, for good measure.

Leave a Comment