gpt4 book ai didi

javascript - 'react-scripts' 未被识别为内部或外部命令

转载 作者:IT老高 更新时间:2023-10-28 21:53:57 26 4
gpt4 key购买 nike

我有一个 maven 项目,其中的 JavaScript 项目被克隆为一个 git 子模块。所以目录结构看起来像 mavenapp/src/main/javascript/[npm project files]

在我的 package.json 中,测试如下所示:

"test": "react-scripts test --env=jsdom",

但是当我尝试运行 npm test 时,它说

'react-scripts' is not recognized as an internal or external command,

有趣的是,当我独立克隆 javascript 项目时,我没有收到此错误。我试过重新运行 npm install

NPM 版本:5.5.1
Node.js 版本:9.3.0

最佳答案

安装时 node_modules/ 目录中缺少 react-scripts 文件的错误。

检查你的 react-script 依赖在 package.json 中是否可用。

如果不可用,则通过以下方式手动添加:

npm install react-scripts --save

关于javascript - 'react-scripts' 未被识别为内部或外部命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47928735/

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