我一直在研究这个 React 项目,几个月以来没有遇到过这个错误。我没有对项目树中 index.html 文件的位置进行任何更改,这就是我无法解释此错误的原因。
我尝试了以下措施但没有成功:
- 更改公用文件夹的位置
- 更改公用文件夹内容的位置
- 更改 package-lock.json 的位置
- 更改 package.json 的位置
- 安装
- npm install react-scripts --save
请找出终端显示的错误:
Could not find a required file.
Name: index.html
Searched in: /Users/Sujay/Documents/Documents/Learn Web Development the Hard Way/lacapsule/project/Dark Sky Map Bitbucket/darkskymap_frontend/public
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! frontend@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the frontend@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/Sujay/.npm/_logs/2019-08-06T07_12_22_366Z-debug.log
Expected result : React project should launch without any issue.
Actual result: Error message in terminal mentioned above.