简体   繁体   English

npm 在尝试创建反应应用程序时开始抛出错误

[英]npm start throwing error when trying to create a react app

I am new to web development using react.我是使用 react 开发 web 的新手。 So, i did the following - npm install -g create-react-app create-react-app my-app cd my-app npm start所以,我做了以下 - npm install -g create-react-app create-react-app my-app cd my-app npm start

But, it is throwing a error which are as follows:但是,它会抛出一个错误,如下所示:

E:\Study\React-course\React-app\my-app>npm start

> my-app@0.1.0 start E:\Study\React-course\React-app\my-app
> react-scripts start

i 「wds」: Project is running at http://192.168.1.5/
i 「wds」: webpack output is served from
i 「wds」: Content not from webpack is served from E:\Study\React-course\React-app\my-app\public
i 「wds」: 404s will fallback to /
Starting the development server...

events.js:291
      throw er; // Unhandled 'error' event
  ^

Error: spawn cmd ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:274:12)
    at onErrorNT (internal/child_process.js:468:16)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -4058,
  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! my-app@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-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!     C:\Users\asus\AppData\Roaming\npm-cache\_logs\2020-07-20T07_10_52_845Z-debug.log

E:\Study\React-course\React-app\my-app>

Instead of using this (npm install -g create-react-app create-react-app) try creating react app using ( npx create-react-app my-app) And for more clarification follow this https://create-react-app.dev/docs/getting-started/而不是使用这个 (npm install -g create-react-app create-react-app) 尝试使用 (npx create-react-app my-app) 创建反应应用程序并且为了更清楚地遵循这个https://create-react- app.dev/docs/getting-started/

Please do not write a special character on your local system folder请不要在本地系统文件夹中写入特殊字符

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 npm start throwing Sass Dart Error "Bad state: Can't access parent outside of a module" in Create React App - npm start throwing Sass Dart Error "Bad state: Can't access parent outside of a module" in Create React App 尝试在iPhone上构建React Native应用时出现'npm start'错误? - Getting 'npm start' error when trying to build React Native app on iphone? 将'npm start'与'create-react-kotlin-app'创建的应用程序一起使用时出错 - error when using 'npm start' with app created by 'create-react-kotlin-app' 在运行“create-react-app my-app”后尝试运行“npm start”时出现一堆错误 - Get a bunch of errors when trying to run “npm start” after running “create-react-app my-app” 在npm上启动启动应用程序时出错 - Getting error on npm start create-react-app create-react-app 和 npm 启动时出现错误“找不到模块” - Error "Module not found" while create-react-app and npm start npm-start 上未处理的错误,使用 create react app - unhandled error on npm-start with create react app npm 使用 create-react-app 时启动不运行 - npm start not running when using create-react-app 运行 npm start 创建 React 应用程序时缺少脚本 - Missing Script when I run npm start to create React app 在创建反应项目时在“npx create-react-app my-app”之后运行命令“npm start”时出错 - getting error when run command 'npm start' after 'npx create-react-app my-app' in creating a react project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM