reactjs - npm start 突然停止在 react 应用程序上工作
问题描述
我已经学习了大约两周的反应,突然 npm start 无法运行。这就是我得到的:
sh: react-scripts: command not found
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! recipe-app@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the recipe-app@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/Michelle/.npm/_logs/2020-07-29T14_35_20_988Z-debug.log
经过大量谷歌搜索后,我尝试
npm install -g npm@latest
了但许可被拒绝。
多次删除并重新安装节点,尝试使用 Homebrew 等,但没有任何效果。
编辑:找到解决方案!Npm 找不到 react-scripts,所以我不得不将脚本更改package.json
为
"start": "node_modules/react-scripts/bin/react-scripts.js start"
.
解决方案
您需要安装反应脚本
npm install react-scripts
推荐阅读
- hive - Hive count(1) 导致 oom
- amazon-web-services - 使用 AWS Chatbot 从松弛通道调用 AWS lambda 函数 - 自动化它,无需用户干预
- python - django 的“重定向”功能不起作用,提交表单后,用户仍然在同一页面上
- docker - 无法创建镜像/Dockerfile(Dockerfile)不能为空
- php - 如何显示该类别中的产品数量?在 laravel 中使用 Eloquent ORM
- reactjs - 如何在 Reactjs 中提交表单?(表格提交)
- omnet++ - 如何确定是否存在网络拥塞?或如何在 V2V 和 V2I 网络中造成拥塞?
- google-speech-to-text-api - Google Speech to Text API 填充词
- java - 将列表输出到文件
- automation - 仅当活动窗口为给定大小时,如何禁用热键?