Mac OS Catalina (10.15.7)
I did a brew install npm
and now am trying to run an app locally, and I get this. I don't have a node_modules
directory that a lot of the posted solutions recommend to be deleted. I also removed my package-lock.json
file to no avail.
Note this did not happen on an AWS-linux instance.
$ npm install
node:internal/modules/cjs/loader:928
throw err;
^
Error: Cannot find module '../lib/cli.js'
Require stack:
- /usr/local/lib/node_modules/npm/bin/npm-cli.js
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)
at Function.Module._load (node:internal/modules/cjs/loader:769:27)
at Module.require (node:internal/modules/cjs/loader:997:19)
at require (node:internal/modules/cjs/helpers:92:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:2:1)
at Module._compile (node:internal/modules/cjs/loader:1108:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)
at Module.load (node:internal/modules/cjs/loader:973:32)
at Function.Module._load (node:internal/modules/cjs/loader:813:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/usr/local/lib/node_modules/npm/bin/npm-cli.js' ]
}
What to do? Thanks.
question from:
https://stackoverflow.com/questions/65647582/npm-install-fails-on-mac-os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…