React脚手架 npm start运行报错

411 阅读1分钟

create-react-app创建应用后使用npm start报错

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! demo1@0.1.0 start: react-scripts start
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the demo1@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!     D:\Program Files\nodejs\node_cache_logs\2021-10-13T12_09_20_406Z-debug.log

出现上述错误可以尝试在项目目录中创建.env文件,在文件中输入下面一行

skip_preflight_check=true

​ 重新运行 npm start