react 使用react-app-rewired后启动不了

使用了

"scripts": {
"start": "react-app-rewired start",
"build": "react-app-rewired build",
"test": "react-app-rewired test",
"eject": "react-app-rewired eject"
},

后报错信息如下:

internal/modules/cjs/loader.js:638
throw err;
^
Error: Cannot find module 'react-scripts/package.json'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.resolve (internal/modules/cjs/helpers.js:33:19)
at Object.<anonymous> (C:\...\node_modules\react-app-rewired\scripts\utils\paths.js:27:11)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-blog@0.1.0 start: `react-app-rewired start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-blog@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! C:\...AppData\Roaming\npm-cache\_logs\2019-11-02T08_08_28_567Z-debug.log

报错第一行就能看到如何解决:

npm install react-scripts

然后重新启动

npm start

即可

posted on   2481  阅读(7013)  评论(1编辑  收藏  举报

编辑推荐:
· SQL Server 内存占用高分析
· .NET Core GC计划阶段(plan_phase)底层原理浅谈
· .NET开发智能桌面机器人:用.NET IoT库编写驱动控制两个屏幕
· 用纯.NET开发并制作一个智能桌面机器人:从.NET IoT入门开始
· 一个超经典 WinForm,WPF 卡死问题的终极反思
阅读排行:
· 在 Windows 10 上实现免密码 SSH 登录
· C#中如何使用异步编程
· SQL Server 内存占用高分析及解决办法(超详细)
· ffmpeg简易播放器(1)--了解视频格式
· 20250116 支付宝出现重大事故 有感

导航

< 2025年1月 >
29 30 31 1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31 1
2 3 4 5 6 7 8

统计

点击右上角即可分享
微信分享提示