gpt4 book ai didi

npm - 错误 : Cannot find module '../lib/cli.js'

转载 作者:行者123 更新时间:2023-12-05 00:54:44 24 4
gpt4 key购买 nike

我安装了 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' ]
}

无论我喜欢用 npm 做什么,错误都会出现。我正在使用 Mac OSX 10.14.6

节点版本:15.4.0 yarn 版本:1.22.10

感谢您的帮助。

最佳答案

这发生在我使用 brew install node 时。我通过执行 brew uninstall node (只是为了清理)然后通过从 https://nodejs.org/ 下载包来安装 nodejs 来修复它。

关于npm - 错误 : Cannot find module '../lib/cli.js' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65719110/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com