React-native 开发问题汇总

1. 入门网站

https://reactnative.dev/docs/getting-started

https://reactnative.cn/docs/getting-started

2. 更换npm国内源
a、临时使用
npm --registry https://registry.npm.taobao.org install express
 
b、持久使用 
npm config set registry https://registry.npm.taobao.org
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist --global
// 配置后可通过下面方式来验证是否成功
npm config get registry
// 或
npm info express
c. 更换回官方源
npm config set registry https://registry.npmjs.org/

 

3. react-native run-andriod的时候,卡在Resolve dependencies of:
A. 除了第一次,以后都可以断网
2. 在项目>android>build.gradle添加如下加粗代码
allprojects {
    repositories {
        google(){ url 'https://maven.aliyun.com/repository/google' }
        mavenLocal()
        maven {
            // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
            url("$rootDir/../node_modules/react-native/android")
        }
        maven {
            // Android JSC is installed from npm
            url("$rootDir/../node_modules/jsc-android/dist")
        }

        jcenter() { url 'https://maven.aliyun.com/repository/public' }
        

        // picker-image
        //maven { url 'https://maven.google.com' }
        maven { url 'https://maven.aliyun.com' }
        
        maven { url 'https://www.jitpack.io' }
    }
}

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值