react初始化代码下载太慢的解决方案

react官方提供的初始方式:

npx create-react-app my-app
cd my-app
npm start

 

这个方式的第一句

npx create-react-app my-app

是从官网  https://registry.npmjs.org/

下载源码,并执行npm install命令下载模块,其中下载源码的过程太慢,起码半小时也下载不下来。下载依赖包的命令倒是挺快。

遇到这个问题的人很多。

我从境外服务器上,执行

npx create-react-app my-app

 

很快,做了一个公共仓库,把这部分源码下载下来,原封不动的做成开源项目,供大家免费使用。仓库名:https://github.com/geektcp/react-init.git

初始化命令如下:

git clone https://github.com/geektcp/react-init.git
cd react-init
npm install npm start

 

posted @ 2022-11-09 17:54  狂奔的骆驼  阅读(233)  评论(0编辑  收藏  举报