文章页正文上
今天小编给大家分享一下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. Installingpackages.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报错如何解决”这篇文章的所有内容,感谢各位的阅读!相信大家阅读完这篇文章都有很大的收获,小编每天都会为大家更新不同的知识,如果还想学习更多的知识,请关注云技术行业资讯频道。
本文小编为大家详细介绍“jquery如何获取class的值”,内容详细,步骤清晰,细节处理妥当,希望这篇“jquery如何获取class的值”文章能帮助大家解决疑惑,下面跟着小编的思路慢慢深入,一起来学习新知识吧。 获取class的值获取class的值非常简单…
文章页内容下