我正在学习反应.我安装的版本是16.我收到一个错误,'react-scripts'被识别为内部或外部命令,可操作程序或批处理文件后,我通过npm安装了prop-types."
在 Windows 中,当我尝试构建 React 应用程序时,我收到错误消息,提示“GENERATE_SOURCEMAP”未被识别为内部或外部命令。
我在 package.json 文件中添加了以下行
"build": "GENERATE_SOURCEMAP=false react-scripts build"
Run Code Online (Sandbox Code Playgroud) 我遵循 udemy 课程,使用create-react-app,然后使用npm start. 它工作正常,直到我安装react-router-dom然后我在终端中收到此错误:
react-scripts' is not recognized as an internal or external command, operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! venue@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the venue@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Run Code Online (Sandbox Code Playgroud)
有人可以解释一下这是怎么回事吗?以及如何修复它?
谢谢
这是我的远程仓库,我使用“create-react-app”创建了项目:https : //github.com/mattfrancis888/project_2
每当我克隆项目并尝试使用 npm start 启动它时。它给了我:
'react-scripts' 不是内部或外部命令,也不是可运行的程序或批处理文件。
这是为什么?我试过:
做'npm i'
npm install react-scripts --save('react-scripts' 不被识别为内部或外部命令)
再次删除并克隆项目。
该项目在我的另一台计算机上运行(我制作远程仓库的桌面)