-
Notifications
You must be signed in to change notification settings - Fork 24.7k
Build target hermes-engine: Command PhaseScriptExecution failed with a nonzero exit code #42221
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I'm resolved from #36762 (comment), thanks all! |
This issue was fixed for me by deleting Source: #36762 (comment) |
@GunnarAK thanks my friend!!! It worked for me |
Also working here for a recent project upgraded to RN 0.73.6 🎉 |
Hi, I also tried to disable the herms by : :hermes_enabled => false. Any suggestions?
|
That' didn't work for me, still struggling with this issue. Any clue how to solve it? |
It's already mentioned in Gemfile but please make sure you're using |
I just fixed with issue by linking the Node to command -v node # in my machine that show => /Users/runner/hostedtoolcache/node/18.20.2/arm64/bin/node Then Link that to ln -s /Users/runner/hostedtoolcache/node/18.20.2/arm64/bin/node /usr/local/bin/node Or short cut with: ln -s $(command -v node) /usr/local/bin/node hope that will help you. |
Thanks this saved me to waste more time. |
I had this problem when changing the node version via nvm. I was just using |
With react-native 0.74.2 none of the proposed fix above work |
Same on my end, non of the fixes mentioned above seems to work on react-native 0.74.2 |
Have you figured out the solution, I tried all previous solutions but there is nothing worked with me with react-native 0.74.3 |
same issue for me I can't build on my xcode using "react-native": "^0.74.3", |
I faced this issue when I upgraded my React native app from version |
This works for me!, Many thanks! |
This is working |
if you are doing expo development builds, then do |
Life Saver. This worked for me too |
Thx a lot. This worked for me. My react native version is 0.74.5. |
Particularly if you are switching node versions with nvm. Thanks! |
|
I just upgrade my project to 0.70.13 to 0.75.1 . I have the same issue while upgrading. Is there any solution?? |
In my case on .xcode.env I changed to this and run the command solved the problem for me |
In my case (RN 0.73.9) when I ran "pod install" it was automatically generating the .xcode.env.local if it didn't already exist. The NODE_BINARY it was setting in that file was set to a location of node, but it wasn't the same as the location that appeared when I would run "which node". After replacing the default NODE_BINARY location with the path from "which node" everything worked correctly. Subsequent runs of "pod install" don't overwrite the change either which is nice. For my set-up, I'm using NVM as my node manager. Also .xcode.env (note: NOT the local one) is just set to:
|
Finally found the solution for RN 0.74.5 (might work for any version starting from 0.73). For those like me who tried the solutions above, the missing piece of the puzzle could be the node install cleaning. Clean node install
Side notesI didn't delete I do have the following patch for "find-node-for-xcode.sh"
|
The best solution for this is to delete the |
Thanks a lot! This is working with XCode 15 , nvm and react-native 0.74.5 |
I have resolved it by changing: |
The above solution working fine when you are installing Cocoapods using The issue here is it creates a |
This really worked for me. I deleted my .xcode.env file and ran pod install, but that didn't work. Then, I also deleted .xcode.env.local and ran pod install again. Then I successfully built my project in Xcode. |
That works: mac m3 |
facing same issue
|
Literally this made my day. Basically the node path at .xcode.env is not working and in order to avoid modifying it we can replace it with a hardcoded local route in our .xcode.env.local :) working like charm now! |
this also worked for me, Thanks |
To resolve the "Build target hermes-engine: Command PhaseScriptExecution failed with a nonzero exit code" error, you can try the following steps: 1. Set Correct NODE_BINARY PathMake sure the correct Node.js binary is being used by setting the export NODE_BINARY=$(which node) 2. Clean Git-Ignored Files and Reinstall DependenciesRun the following command to clean git-ignored files, remove build artifacts, and reinstall dependencies: "cleanGitIgnoredFiles": "rm -rf .jso node_modules package-lock.json yarn.lock && cd ios && rm -rf build pods .xcode.env.local Podfile.lock && cd .. && cd android && rm -rf build && cd app && rm -rf build && cd .. && cd .. && yarn installAll",
"installAll": "yarn install && cd ios && pod install && cd .." This script will:
3. Delete .xcode.env.local (if needed)If the issue persists, try deleting the rm -rf .xcode.env.local |
This works for me as well. My xcode env local file was using node 18 and my machine was using 22. |
Solution That Worked for Me: Steps to Fix: rm ~/.xcode.env.local cd ios npx react-native run-ios Why This Works: |
None of the suggested solutions works for me Xcode version 16.3 |
please for |
As mentioned above, export NODE_BINARY=<static_node_path> worked. Although I already had the static path, I was still encountering this issue. I later noticed that my path was not wrapped in double quotes (""), and adding them resolved the problem. |
Did you resolve the issue? |
post_install do |installer| installer.pods_project.targets.each do |target| ----> Add this post_install block at the bottom of the Podfile |
In my case, the problem was due to an incorrect REACT_NATIVE_PATH. The error message pointed to a specific script—when I opened that script in my editor, I saw it was trying to reference REACT_NATIVE_PATH, but the path it was using didn’t exist. To fix it, I defined the correct REACT_NATIVE_PATH as a user environment variable. Once I did that, the issue was resolved. Carefully read the full error message it usually mentions the script where the error originates. Open that script to investigate further; it often provides valuable clues. |
Description
I am facing the following problem after running my project again, the pod installed successfully without any problem, but when running using yarn run ios command, the error as below occurs, has anyone encountered this? like me? please help me. Yesterday I ran React Native version 0.73.1 and it still worked fine. Today, when I upgraded to 0.73.2, the following problem occurred. I also downgraded back to 0.73.1 but still no luck.
Steps to reproduce
React Native Version
0.73.2
Affected Platforms
Runtime - iOS, Build - MacOS
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com/yedi97/reproducer-react-native
Screenshots and Videos
The text was updated successfully, but these errors were encountered: