gpt4 book ai didi

reactjs - 使用并发构建的 React.js 找不到构建命令 [react-scripts : command not found]

转载 作者:行者123 更新时间:2023-12-02 18:42:10 24 4
gpt4 key购买 nike

我正在尝试在 Elastic Beanstalk 上部署一个使用 Express 并同时使用的 React 应用程序,但出现错误,指出它无法找到 React-scripts 命令。我已经仔细检查过react-scripts是json中的依赖项(由react自动生成),所以我不太确定为什么它仍然找不到它。

下面是日志

-------------------------------------
/var/log/nodejs/nodejs.log
-------------------------------------
[0]
[0] > project-deztructicus@0.1.0 server-live /var/app/current
[0] > node server.js
[0]
[0] Server started on port 5000
[1]
[1] > client@0.1.0 start /var/app/current/client
[1] > react-scripts start
[1]
[1] sh: react-scripts: command not found
[1] npm ERR! file sh
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno ENOENT
[1] npm ERR! syscall spawn
[1] npm ERR! client@0.1.0 start: `react-scripts start`
[1] npm ERR! spawn ENOENT
[1] npm ERR!
[1] npm ERR! Failed at the client@0.1.0 start script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1] npm WARN Local package.json exists, but node_modules missing, did you mean to install?
[1] npm ERR! code ELIFECYCLE
[1] npm ERR! errno 1
[1] npm ERR! project-deztructicus@0.1.0 client: `npm start --prefix client`
[1] npm ERR! Exit status 1
[1] npm ERR!
[1] npm ERR! Failed at the project-deztructicus@0.1.0 client script.
[1] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
[1] npm run client exited with code 1

提前非常感谢! :-)

最佳答案

这不是一个 create-react-app 问题,而是一个 npm 问题。检查此链接 https://github.com/npm/npm/issues/17379

关于reactjs - 使用并发构建的 React.js 找不到构建命令 [react-scripts : command not found],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48100288/

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