我安装了yarn/webpack,然后npm崩溃了!我收到以下错误:
npm -v
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' ]
}
Run Code Online (Sandbox Code Playgroud)
无论我喜欢用 npm 做什么,错误都会出现。我正在使用 Mac OSX 10.14.6
节点版本:15.4.0 纱线版本:1.22.10
感谢帮助。
小智 8
我使用时就发生过这种情况brew install node。我通过执行brew uninstall node(只是为了清理)然后通过从 https://nodejs.org/下载软件包来安装 NodeJS 来修复它
| 归档时间: |
|
| 查看次数: |
5855 次 |
| 最近记录: |