【发布时间】:2020-06-07 02:15:25
【问题描述】:
- 我正在学习对此tutorial 的反应。我收到一个关于没有启动脚本的错误,使用我的文本编辑器添加到 package.json 文件中。现在我真的不知道如何解决我的新错误。
- 更新了我的 package-json 文件,卸载并重新安装了 create-react-app,创建了新的 react-app 文件夹,读取了堆栈溢出。使用“npx react-scripts start”手动启动它。
-
我的 npm -v (6.7.0) 和节点 -v (12.16.0)
react-app的文件目录树
- node_modules
- 使用 create-react-app 创建文件夹时添加的文件夹列表
- 公开
- favicon.ico
- index.html
- manifest.json
-
src
- index.js
- .gitignore
- package.json
- package-lock.json
- README.md
- node_modules
错误:
circulating@CLAPP-T460-22 MINGW64 ~/Desktop/react-app (master)
$ npm start
> react-app@1.1.0 start C:\Users\circulating\Desktop\react-app
> react-scripts start
i 「wds」: Project is running at http://192.168.1.16/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from C:\Users\circulating\Desktop\re act-app\public
i 「wds」: 404s will fallback to /
Starting the development server...
events.js:287
throw er; // Unhandled 'error' event
^
Error: spawn cmd ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
at onErrorNT (internal/child_process.js:469:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn cmd',
path: 'cmd',
spawnargs: [ '/s', '/c', 'start', '""', '/b', '"http://localhost:3000/"' ]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-app@1.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-app@1.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional log ging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\circulating\AppData\Roaming\npm-cache\_logs\2020-06-07T01_ 12_36_919Z-debug.log
【问题讨论】:
标签: node.js reactjs npm create-react-app