1

I have seen the other posts with this being solved with Curl--but is there another way to solve this? What happened?

I was having some issues with the newest Node.js (not the lts) and I attempted to uninstall node (using control panel) and then reinstall the LTS version instead.

After installation, I get these errors on ANY npm command:

C:\Windows\System32>npm -v
module.js:549
    throw err;
    ^

Error: Cannot find module 'proto-list'
    at Function.Module._resolveFilename (module.js:547:15)
    at Function.Module._load (module.js:474:25)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\jle01\AppData\Roaming\npm\node_modules\npm\node_modules\config-chain\index.js:1:79)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
SE_net4 the downvoter
  • 21,043
  • 11
  • 69
  • 107
Justin Le
  • 541
  • 5
  • 22
  • Dunno what exactly was edited or why it was downvoted--but sure. I've attempted to uninstall it using the installer now and reinstall to no avail. – Justin Le Jul 20 '18 at 20:03

1 Answers1

2

First make sure node is completely removed:

Taken from How to completely remove node.js from Windows

How to remove Node.js from Windows:

  1. Take a deep breath.

  2. Uninstall from Programs & Features with the uninstaller.

  3. Reboot (or you probably can get away with killing all node-related processes from Task Manager).

  4. 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)

C:\Users{User}\AppData\Local\Temp\npm-*

Check your %PATH% environment variable to ensure no references to Nodejs or npm exist.

  1. 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.

Reboot, for good measure.

Now reinstall.

Justin Le
  • 541
  • 5
  • 22
  • 1
    I think a better way would have been to figure out where your global `node_modules` resides using `npm root -g`. Remove that directory using `rm -rf node_modules`. Then run `npm install`. – benSooraj Jul 23 '18 at 16:17
  • 1
    Unfortunately--I couldn't do this because the NPM commands were broken. – Justin Le Jul 23 '18 at 16:21
  • This did however, resolve my issue. Also these rm -rf commands, do they work in windows? Maybe I would have to use powershell? I'm pretty new to this but I thought those were linux/bash commands..? – Justin Le Jul 23 '18 at 16:21
  • 1
    You're right. These are linux commands. However, you should be able to look up the equivalent command in windows as well. This should help: [“rm -rf” equivalent for Windows?](https://stackoverflow.com/questions/97875/rm-rf-equivalent-for-windows). – benSooraj Jul 23 '18 at 16:30
  • If I have a similar issue in the future--I'll refer to this thread, Appreciated ben. – Justin Le Jul 23 '18 at 19:39