I am encountering an issue running npm on Win10 that has been reported before, but around 8 years ago: enter link description here
I also see it reported on Win10, but don't see a real answer: enter link description here
I recently installed Node, version 16.17.1. If I type node in a terminal then it works OK. However, if I type npm I get:
npm
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module 'C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
My Env Variables System variables contains the entry "C:\Program Files\nodejs" and nothing else.
To be honest, I'm baffled by the report error since it points to "C:\Program Files\nodejs\node_modules\npm\bin", whereas I have "C:\Program Files\nodejs\node_modules/.bin" with a .bin. I have no /bin folder and the /.bin folder is empty.