- 通过国内镜像安装
Homebrew
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
brew install ruby // 安装ruby
brew install cocoapods // 安装pod
pod install安装很慢。试一试如下配置
# 添加如下行启用国内镜像
source 'https://mirrors.tuna.tsinghua.edu.cn/git/CocoaPods/Specs.git'
require Pod::Executable.execute_command('node', ['-p',
'require.resolve(
"react-native/scripts/react_native_pods.rb",
{paths: [process.argv[1]]},
)', __dir__]).strip
npm安装报错
request to https://registry.npm.taobao.org/jssha/download/jssha-2.0.0.tgz failed, reason: certificate has expired
解决方案
npm config set strict-ssl false //关闭ssl校验
npm i