Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native 0.73.1 - Command PhaseScriptExecution failed with nonzero exit code

We have recently begun the process of updating out app from React Native 0.72.5 to 0.73.1, however currently whenever I try and buily the app locally on my M1 Macbook Pro using XCode, the build fails within seconds with the following hermes-engine error:

Command PhaseScriptExecution failed with a nonzero exit code

I have done a lot of Googling around this error and the consensus seems to be this will be related to the change in node version (we were previously running 16.20.0 but we have now updated the version to 18.18.2). We manage our node versions using nvm and I have set the default on my machine to the same version using the app by running nvm alias default 18.18.2, so XCode should be using the correct node version. I have cleared out the Derived Data folder, run a clean build etc. and no matter what, I still get the same error.

Any ideas on what I'm doing wrong here? Is this issue definitely still related to the node version and if so, how can I fix the issue? Thanks.

like image 742
LaikaTheSpaceDog Avatar asked Mar 19 '26 03:03

LaikaTheSpaceDog


1 Answers

This also worked for me:

This issue was fixed for me by deleting ios/.xcode.env.local. Then I ran pod install and installed the app successfully on my device.

Courtesy of:

https://github.com/facebook/react-native/issues/42221#issuecomment-1895955415

like image 125
lol Avatar answered Mar 21 '26 15:03

lol