Apple M2 – Command PhaseScriptExecution 失败,退出代码为非零。

huangapple go评论61阅读模式
英文:

Apple M2 - Command PhaseScriptExecution failed with a nonzero exit code

问题

我有一个React Native项目。最近在系统升级后,我注意到项目没有构建。系统是macOS Ventura 13.3.1Apple M2 Pro。Xcode版本是14.3。Cocoapods版本是1.12.1

我得到了

>node: command not found Command PhaseScriptExecution failed with a nonzero exit code under RealmJS

我不确定这个错误是在什么时候开始出现的,但我尝试了互联网提供的每个解决方案,但都没有起作用。

互联网上提到的大多数解决方案:

  1. Targets -> Build Phases -> Start PackagerTargets -> Build Phases -> React Native code and images以及Targets -> Build Phases -> Embedded pods frameworks中检查Run script only when installing
  2. arch -x86_64 pod deintegrate; pod install
  3. Build settings -> Excluded Architectures中添加并删除arm64
  4. 确保在Pods -> Target Support Files -> Pods-THE_APP-Frameworks中有source="$(readlink -f "${source}")"

有新的建议吗?

英文:

I have React Native project. Recently after some upgrade on system I noticed that the project is not built. It's on macOS Ventura 13.3.1, Apple M2 Pro. Xcode version is 14.3. Cocoapods version is 1.12.1.

I'm getting

>node: command not found Command PhaseScriptExecution failed with a nonzero exit code under RealmJS

I'm not sure after what this error started appearing, but I tried every solution internet offered, but none of them worked.

Most mentioned internet solutions:

  1. Check Run script only when installing in Targets -> Build Phases -> Start Packager; Targets -> Build Phases -> React Native code and images and Targets -> Build Phases -> Embedded pods frameworks.
  2. arch -x86_64 pod deintegrate; pod install
  3. In Build settings -> Excluded Architectures add and delete arm64.
  4. Make sure to have source="$(readlink -f "${source}")" in Pods -> Target Support Files -> Pods-THE_APP-Frameworks.

Any new suggestions?

答案1

得分: 1

编辑 ${yourProject}node_modules/react-native/scripts/find-node.sh 文件,移除(在我这种情况下)nvm if statement,因为我正在使用 nvm。

英文:

For everybody else who's struggling with this one, I managed to solve this by editing

> ${yourProject}node_modules/react-native/scripts/find-node.sh

and (in my case) removing the nvm if statement since I'm using nvm.

答案2

得分: 0

cd ios

pod cache clean --all

Pod clean

pod deintegrate

sudo gem install cocoapods-deintegrate cocoapods-clean

sudo arch -x86_64 gem install ffi

arch -x86_64 pod repo update

arch -x86-64 pod install

英文:

Try this

cd ios

pod cache clean --all

Pod clean

pod deintegrate

sudo gem install cocoapods-deintegrate cocoapods-clean

sudo arch -x86_64 gem install ffi

arch -x86_64 pod repo update

arch -x86_64 pod install

huangapple
  • 本文由 发表于 2023年5月22日 11:18:19
  • 转载请务必保留本文链接:https://go.coder-hub.com/76302843.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定