英文:
Apple M2 - Command PhaseScriptExecution failed with a nonzero exit code
问题
我有一个React Native项目。最近在系统升级后,我注意到项目没有构建。系统是macOS Ventura 13.3.1,Apple M2 Pro。Xcode版本是14.3。Cocoapods版本是1.12.1。
我得到了
>node: command not found Command PhaseScriptExecution failed with a nonzero exit code under RealmJS
我不确定这个错误是在什么时候开始出现的,但我尝试了互联网提供的每个解决方案,但都没有起作用。
互联网上提到的大多数解决方案:
- 在Targets -> Build Phases -> Start Packager;Targets -> Build Phases -> React Native code and images以及Targets -> Build Phases -> Embedded pods frameworks中检查
Run script only when installing
。 arch -x86_64 pod deintegrate; pod install
- 在Build settings -> Excluded Architectures中添加并删除
arm64
。 - 确保在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:
- 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. arch -x86_64 pod deintegrate; pod install
- In Build settings -> Excluded Architectures add and delete
arm64
. - 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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论