Since today I can't use any npm command.
Here's what I get everytime:
internal/modules/cjs/loader.js:584
throw err;
^
Error: Cannot find module 'C:\Users\Adrien\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
I use Windows 10. The commands for node work. I tried to uninstall Node.js, change the path in environment variables, but nothing changes...
Everything worked fine until I work on my new React.js project and got errors.
I have no npm folder in C:\Users\Adrien\AppData\Roaming\npm\node_modules
Thank you for your help.
Simply just restart your PC, refresh code editor and run the command.
Spent the past 24 hrs trying to resolve this and good now:
Go to settings - apps - node.js.
Here, two options prevail, 'modify' or 'unistall', select 'modify' and then press the 'repair' button which appears on the next dialogue window. Doing so will re-install a complete set of the files.
Go to PwerShell (Windows) or Bash (Mac) and type in 'npm -v', you should get a positive return, i.e., a display of the npm version number successfully installed.
I needed to resolve this as a pre-requisite to installing Truffle to support my Ethereum development environment.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With