简体   繁体   English

使用 create react app 创建新应用时收到错误

[英]Receiving error when creating new app using create react app

For some reason when trying to create a new app using create react app, it results in errors everytime.由于某种原因,在尝试使用 create react app 创建新应用时,每次都会导致错误。 Anybody know what's going on?有人知道发生了什么吗?

Error Stack错误堆栈错误堆栈

Have you tried it without the additional --use-npm flags at the end?您是否在最后没有附加--use-npm标志的情况下尝试过?

npx create-react-app user-onboarding
cd user-onboarding
npm start

Official docs官方文档

Edit: Yeah, reading your errors in the screenshot it appears that the --use-npm flag is causing it to use npm which has outdated versions available, but npx always finds the newest versions.编辑:是的,在屏幕截图中阅读您的错误似乎是--use-npm标志导致它使用 npm 可用的过时版本,但npx总是找到最新版本。 Which is a big reason it is the preferred method for installing create-react-app这是安装create-react-app的首选方法的一个重要原因

If you have your heart set on using npm you can always do an npm update before running it again.如果您决心使用npm ,您可以在再次运行之前始终进行npm update

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM