react-native 问题点2024

446 阅读1分钟
  1. 通过国内镜像安装Homebrew
/bin/bash -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
brew install ruby // 安装ruby
brew install cocoapods // 安装pod
  1. 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
  
  1. 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