0
votes

I upgraded Node from version 10.17 to 12.6.1 on my Windows 10 Pro x64 machine and npm does not run. The error i get is:

internal/modules/cjs/loader.js:985 throw err; ^

Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\node_modules\npm\bin\npm-cli.js' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:982:15) at Function.Module._load (internal/modules/cjs/loader.js:864:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12) at internal/main/run_main_module.js:18:47 { code: 'MODULE_NOT_FOUND', requireStack: [] } internal/modules/cjs/loader.js:985 throw err; ^

I have tried so far:

  • All the answers and solutions on this question and the issue still persists.

  • Uninstalling Node, deleting all npm, node_modules and node folders on Program Files and AppData, rebooting, installing node again, rebooting and it still did not work.

  • Reinstalling npm as per the instructions here

My system Path variable contains C:\Program Files\nodejs\ and my user Path variable contains C:\Program Files\nodejs\;C:\Users\{User}\AppData\Roaming\npm

What am I missing here? Can anyone guide me?

1
what npm -v shows in console ?Deep Kakkar
@DeepKakkar The same error which I have posted in the question.minus.273
I believe your node js not installed or configured properly, you should remove and install node js againDeep Kakkar
I have tried that, as stated in my question. And the error persists.minus.273

1 Answers

0
votes

I moved the folder of node to the folder of the project end update the path end it finally solved the problem no idea why