今天小编给大家分享一下creat react app报错如何解决的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。 creat react app报错的解决办法:1、通过“npm config set registry https://registry.npm.taobao.org”切换淘宝镜像源;2、通过执行“E:workspacedemop4>npx create-react-app todolist”命令重新安装即可。create-react-app安装报错1. 错误原因当创建React应用时候,执行 npx create-react-app todolist, 报以下错误:
E:workspacedemop4>npxcreate-react-apptodolist npmERR!codeETIMEDOUT npmERR!syscallconnect npmERR!errnoETIMEDOUT npmERR!networkrequesttohttps://registry.npmjs.org/create-react-appfailed,reason:connectETIMEDOUT104.16.16.35:443 npmERR!networkThisisaproblemrelatedtonetworkconnectivity. npmERR!networkInmostcasesyouarebehindaproxyorhavebadnetworksettings. npmERR!network npmERR!networkIfyouarebehindaproxy,pleasemakesurethatthe npmERR!network'proxy'configissetproperly.See:'npmhelpconfig' npmERR!Acompletelogofthisruncanbefoundin: npmERR!C:UsersstormAppDataLocalnpm-cache_logs2022-12-13T05_17_26_631Z-debug-0.log
2. 解决办法切换淘宝镜像源
#换源 npmconfigsetregistryhttps://registry.npm.taobao.org #查看 npmconfiggetregistry
执行结果如下:
E:workspacedemop4>npmconfigsetregistryhttps://registry.npm.taobao.org E:workspacedemop4>npmconfiggetregistry https://registry.npm.taobao.org/
3. 再次安装
E:workspacedemop4>npxcreate-react-apptodolist CreatinganewReactappinE:workspacedemop4todolist. Installin免费云主机域名gpackages.Thismighttakeacoupleofminutes. Installingreact,react-dom,andreact-scriptswithcra-template... added1395packagesin1m Initializedagitrepository. Installingtemplatedependenciesusingnpm... added71packagesin4s Removingtemplatepackageusingnpm... removed1packagein2s Createdgitcommit. Success!CreatedtodolistatE:workspacedemop4todolist Insidethatdirectory,youcanrunseveralcommands: npmstart Startsthedevelopmentserver. npmrunbuild Bundlestheappintostaticfilesforproduction. npmtest Startsthetestrunner. npmruneject Removesthistoolandcopiesbuilddependencies,configurationfiles andscriptsintotheappdirectory.Ifyoudothis,youcan’tgoback! Wesuggestthatyoubeginbytyping: cdtodolist npmstart Happyhacking!
以上就是“creat react app报错如何解决”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注百云主机行业资讯频道。
这篇“怎么使用Vue代码实现监听”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“怎么使用Vue代码实现监听”文章吧。demo: {{message…
免责声明:本站发布的图片视频文字,以转载和分享为主,文章观点不代表本站立场,本站不承担相关法律责任;如果涉及侵权请联系邮箱:360163164@qq.com举报,并提供相关证据,经查实将立刻删除涉嫌侵权内容。