0

While running npm command I get the error

Error: Cannot find module 'C:\Windows\System32\node_modules\npm\bin\npm-cli.js'. I tried uninstalling and installing nodejs but with no luck. Also I tried configuring the env vars

Rubin bhandari
  • 1,873
  • 15
  • 20
  • Possible duplicate of [Fixing npm path in Windows 8 and 10](https://stackoverflow.com/questions/27864040/fixing-npm-path-in-windows-8-and-10) – RobC Jun 14 '18 at 16:28

1 Answers1

0

I'm not entirely sure about this, but I dont remember having nodejs/npm installed in Windows directory. It should be in your Appdata somewhere. Your install Paths maybe somehow corrupted

But here is a possible solution: Go here:

Install it and run the following commands:

nvm list 
nvm install [version]

for example:

nvm install v10.15.3

The Command should automatically select the installed version as default. For further information check their Github Readme.

If they don't work right off, be sure to restart the Version Manager OR be sure to follow the instructions led out by the Github Readme.

Version Manager have one big benefit: The Community keeps them updated and because they use different Path architectures they can be installed at places where they weren't originally meant to be from the original installer which lead to a whole different outcome for you because they probably will not install directly into System32.

Other Node Version Manager you could check out (should all be Windows):

Hope it helps!

Naing Lin Aung
  • 3,373
  • 4
  • 31
  • 48
Eden
  • 53
  • 7