Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command PhaseScriptExecution failed with a nonzero exit code - Xcode 13.4.1

I'm using M1 chip and xCode 13.4.1. I get the following React Native error while executing the app in the simulator:

The following build commands failed: PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/Ibra/Library/Developer/Xcode/DerivedData/Mario-girhlsdkqiibhqhflwlyrybpo/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-46EB2E110.sh (in target 'FBReactNativeSpec' from project 'Pods') (1 failure)

The problem persists even when I start a brand-new React Native project and try to execute it on iOS. What led to the error and how can it be fixed?

Thank you

like image 259
Mir Stephen Avatar asked Sep 03 '25 06:09

Mir Stephen


1 Answers

Solution: It's node version mismatch version.

During the initial execution of 'pod install,' a file named '.xcode.env.local' was automatically generated in the '/ios' directory. This file contained the line

'$NODE_BINARY=/opt/homebrew/Cellar/node/20.8.0/bin/node.'

To know the exact path of Node I typed "which node" whatever you get just paste that path inside '.xcode.env.local' file.

I resolved the problem by updating this line only.

like image 53
Pratik Gondaliya Avatar answered Sep 05 '25 01:09

Pratik Gondaliya