React Native npm镜像安装命令

打开控制台,分别执行这两行命令(npm镜像加速后面的过程)

npm config set registry https://registry.npm.taobao.org –global 
npm config set disturl https://npm.taobao.org/dist –global 

之后执行(Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载)
npm install -g yarn react-native-cli
再然后执行(yarn后同理也要设置镜像源)

yarn config set registry https://registry.npm.taobao.org –global 
yarn config set disturl https://npm.taobao.org/dist –global

新建一个文件夹,按ctrl键并点击鼠标右键在该目录下打开cmd命令窗口,执行react-native init FirstApp,进行创建项目,FirstApp是项目名称。

猜你喜欢

转载自www.cnblogs.com/leonmangochen/p/9753749.html