Any time I try and run any "npm" command, I get the error below around not being able to find the config for npmcli.
Error: Cannot find module '@npmcli/config'
Require stack:
- C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\npm.js
- C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\cli-entry.js
- C:\Users\User\AppData\Roaming\npm\node_modules\npm\lib\cli.js
- C:\Users\User\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15)
at Module._load (node:internal/modules/cjs/loader:922:27)
at Module.require (node:internal/modules/cjs/loader:1143:19)
at require (node:internal/modules/cjs/helpers:121:18)
at Object.<anonymous> (C:\Users\olive\AppData\Roaming\npm\node_modules\npm\lib\npm.js:2:16)
at Module._compile (node:internal/modules/cjs/loader:1256:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)
at Module.load (node:internal/modules/cjs/loader:1119:32)
at Module._load (node:internal/modules/cjs/loader:960:12)
at Module.require (node:internal/modules/cjs/loader:1143:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\npm.js',
'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli-entry.js',
'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\lib\\cli.js',
'C:\\Users\\User\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js'
]
}
So far, I've tried:
Download the latest version of NVM.
On windows, for me this was here: https://github.com/coreybutler/nvm-windows/releases
The latest version at the time of writing was 1.1.11
Exact steps were:
nvm-update.exe
download, on the link abovenvm uninstall 18.17
(or which ever version was failing)nvm install 18.17
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