反应原生项目不在 MacBook M1 上构建 [英] react native project not build on MacBook M1

查看:24
本文介绍了反应原生项目不在 MacBook M1 上构建的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在新的 MacBook M1 pro 中更换了我的 MacBook,并发布了一个旧项目.

我在我使用的旧项目上工作:

expo(40版)哪一个被弹出和使用

react-native(版本 ~0.63.4)

当我尝试构建(命令:react-native run-ios)项目时,它总是返回错误,但是当我创建新项目时,一切正常.不知道是什么问题.

解决方案

我找到了一个解决方案.

首先我清理项目并再次安装所有内容,然后开始构建.

命令:

<块引用>

watchman watch-del-all &&rm -rf node_modules &&rm -rf yarn.lock &&rm -rf package-lock.json &&纱线缓存清理&&纱线&&cd ios &&rm -rf Pods &&rm -rf Podfile.lock &&吊舱安装 &&cd .. &&cd安卓&&./gradlew clean &&cd .. &&yarn start --reset-cache

之后,我开始使用以下命令构建:

<块引用>

arch -x86_64 yarn run ios

<块引用>

arch -x86_64 react-native run-ios

I change my MacBook within new MacBook M1 pro and have issue an old project.

I work on old project where I use:

expo(version 40) which one is ejected and use

react-native(version ~0.63.4)

and when I try to build(command: react-native run-ios) project It return errors always, but when I make new project everything is Okay. I don't know what is problem.

解决方案

I found one solution.

Firstly I clean project and install everything again, then start building.

Commands:

watchman watch-del-all && rm -rf node_modules && rm -rf yarn.lock && rm -rf package-lock.json && yarn cache clean && yarn && cd ios && rm -rf Pods && rm -rf Podfile.lock && pod install && cd .. && cd android && ./gradlew clean && cd .. && yarn start --reset-cache

After that I start build with this command:

arch -x86_64 yarn run ios

or

arch -x86_64 react-native run-ios

这篇关于反应原生项目不在 MacBook M1 上构建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆