'react-scripts'不被识别为内部或外部命令 [英] 'react-scripts' is not recognized as an internal or external command

查看:1833
本文介绍了'react-scripts'不被识别为内部或外部命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个maven项目,其中的JavaScript项目被克隆为git子模块.所以目录结构看起来像

I've got a maven project, within which is JavaScript project cloned as a git sub-module. So the directory structure looks something like

mavenapp/src/main/javascript/[npm project files]

在我的package.json中,测试如下:"test": "react-scripts test --env=jsdom",

inside my package.json, the test looks like this : "test": "react-scripts test --env=jsdom",

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

but when I try to run npm test is says

'react-scripts'不被识别为内部或外部命令,

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

有趣的是,当我独立克隆javascript项目时,没有出现此错误.我尝试重新运行npm install.

Interestingly when I clone the javascript project independently I don't get this error. I've tried re-running npm install.

npm version : 5.5.1

node version : 9.3.0

推荐答案

这是关于在您的节点模块目录中缺少反应脚本文件的错误.安装.

It is an error about react-scripts file missing in your node modules directory at the time of installation.

package.json

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

If not available then add manually via:

npm install react-scripts --save

这篇关于'react-scripts'不被识别为内部或外部命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆