gpt4 book ai didi

javascript - 错误 : Cannot find module 'react-dev-utils/inquirer'

转载 作者:行者123 更新时间:2023-12-02 16:23:49 25 4
gpt4 key购买 nike

当我在我的项目中运行这个命令时:

yarn eject

显示这个错误:

[root@VM-0-16-centos cruise-web]# yarn eject
yarn run v1.22.10
$ react-scripts eject
internal/modules/cjs/loader.js:834
throw err;
^

Error: Cannot find module 'react-dev-utils/inquirer'
Require stack:
- /home/dolphin/sync/source/cruise-web/node_modules/react-scripts/scripts/eject.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:831:15)
at Function.Module._load (internal/modules/cjs/loader.js:687:27)
at Module.require (internal/modules/cjs/loader.js:903:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/dolphin/sync/source/cruise-web/node_modules/react-scripts/scripts/eject.js:23:18)
at Module._compile (internal/modules/cjs/loader.js:1015:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1035:10)
at Module.load (internal/modules/cjs/loader.js:879:32)
at Function.Module._load (internal/modules/cjs/loader.js:724:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/home/dolphin/sync/source/cruise-web/node_modules/react-scripts/scripts/eject.js'
]
}

然后我在我的 package.json 中添加一个依赖项:

"react-dev-utils":"11.0.1"

然后运行命令安装并重新运行弹出:

yarn 
yarn eject

但是问题还是没有解决,我应该怎么做才能让它生效?

最佳答案

我刚刚遇到了同样的问题。查看 package.json 上的 react-scripts 版本。我猜想这 ( https://github.com/facebook/create-react-app/pull/10083 ) 是 yarn eject 抛出错误的原因。

我能够通过安装最新版本的 react-script 来解决问题:

npm install react-scripts@4.0.1

关于javascript - 错误 : Cannot find module 'react-dev-utils/inquirer' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64979793/

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