其他分享
首页 > 其他分享> > React Native搭建环境

React Native搭建环境

作者:互联网

刚开始学习React Native 记录一下踩坑
React Native 官网地址:https://reactnative.cn/docs/environment-setup
搭建环境完全按照官网的操作来就可以了,虽然说着很简单,但还是踩了很多的坑

这个方法亲测有效,其他的方法我这边没什么效果

React-native init 初始化时报错   info Installing required CocoaPods dependencies
在网上找了下原因,主要是网络慢或网络连接的原因,解决方案如下:
一、Ctrl + c 退出命令行
二、安装Cocoapods
sudo gem install cocoapods
三、设置镜像
$ cd ~/.cocoapods/repos 
$ pod repo remove master
$ git clone https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git master
四、进入自己的工程, 在自己工程的podFile第一行加上:
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
五、安装
pod install

网速好的情况下 项目初始化是没问题的 如果提示index.js没找到的问题
百度了一下可能原因是就是端口被占用 我不太确定 就重启了下电脑
就好了~~~~

在这里插入图片描述

标签:git,cn,React,https,Native,CocoaPods,搭建
来源: https://blog.csdn.net/m0_50243859/article/details/121053738