Skip to content
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

Command PhaseScriptExecution failed with a nonzero exit code with ios build #44533

Closed
AwsBTek opened this issue May 10, 2024 · 6 comments
Closed
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Triage 🔍 Platform: iOS iOS applications.

Comments

@AwsBTek
Copy link

AwsBTek commented May 10, 2024

Description

When I tried to build the iOS project, I faced this issue:

/Users/pc/Downloads/einvoicing-react-native-mobile-app-1/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/react_native_pods_utils/script_phases.sh: line 86: /usr/local/bin/node
: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code.

My react version: "react-native": "0.70.5",

The script_phases line: 86 is:
image

Steps to reproduce

  1. Yarn.
  2. cd ios.
  3. pod install -> pods installed successfully.
  4. open xcode project.
  5. Product -> build.
  6. image

React Native Version

0.75.0

Affected Platforms

Runtime - iOS

Output of npx react-native info

System:
    OS: macOS 14.4.1
    CPU: (8) arm64 Apple M2
    Memory: 120.72 MB / 8.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.13.1 - ~/.nvm/versions/node/v20.13.1/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.5.2 - ~/.nvm/versions/node/v20.13.1/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.15.2 - /Users/awshakam/.gem/bin/pod
  SDKs:
    iOS SDK:
      Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4
    Android SDK: Not Found
  IDEs:
    Android Studio: 2023.2 AI-232.10300.40.2321.11668458
    Xcode: 15.3/15E204a - /usr/bin/xcodebuild
  Languages:
    Java: Not Found
  npmPackages:
    @react-native-community/cli: Not Found
    react: Not Found
    react-native: Not Found
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found.

Stacktrace or Logs

/Users/pc/Downloads/einvoicing-react-native-mobile-app-1/ios/Pods/../.xcode.env: line 5: 
: command not found
Node found at: /usr/local/bin/node
/Users/pc/Downloads/einvoicing-react-native-mobile-app-1/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/react_native_pods_utils/script_phases.sh: line 87: /usr/local/bin/node
: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

Reproducer

https://github.com/AwsBTek/react_native_issue

Screenshots and Videos

No response

@github-actions github-actions bot added Needs: Author Feedback Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. Platform: iOS iOS applications. and removed Needs: Repro This issue could be improved with a clear list of steps to reproduce the issue. labels May 10, 2024
@Siliconvelly
Copy link

Siliconvelly commented May 11, 2024

Facing same issue on my side i am integrated new latest version of react native 0.74.1 on android side it is running but on ios side it gives error like your (@AwsBTek) mentioned.

Uploading Screenshot 2024-05-11 at 11.47.14 AM.png…

@MUSHTHAK2899
Copy link

check Your Mac storage

@AwsBTek
Copy link
Author

AwsBTek commented May 11, 2024

@MUSHTHAK2899 My Macbook's storage is 415 GB free.

@github-actions github-actions bot added Needs: Attention Issues where the author has responded to feedback. and removed Needs: Author Feedback labels May 11, 2024
@sandipsarkar13
Copy link

sandipsarkar13 commented May 11, 2024

I'm facing the following error on the latest version of react native 0.74.1 (Xcode 15.3)
~/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/hermes-engine.build/Script-46EB2E00030580.sh: line 2: /scripts/xcode/with-environment.sh: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code


The contents of Script-46EB2E00030580.sh
#!/bin/sh
. "$REACT_NATIVE_PATH/scripts/xcode/with-environment.sh"

    CONFIG="Release"
    if echo $GCC_PREPROCESSOR_DEFINITIONS | grep -q "DEBUG=1"; then
      CONFIG="Debug"
    fi

    "$NODE_BINARY" "$REACT_NATIVE_PATH/sdks/hermes-engine/utils/replace_hermes_version.js" -c "$CONFIG" -r "0.74.1" -p "$PODS_ROOT"

@baenacoco
Copy link

I got the error,

ios/.xcode.env => In this file you will found the instructions to set up NODE_BINARY that is necessary for building the project. I tried to set up in my .zhsrc file but it didn´t work because it have to be set up in this file.
So my solution is:
Create or modify a file "ios/.xcode.env.local" with this content "export NODE_BINARY=$(which node)" so you can replace "$(which node)" for your local bin node.

@AwsBTek
Copy link
Author

AwsBTek commented May 15, 2024

@baenacoco
Many thanks; I was able to solve the problem with your help.

@AwsBTek AwsBTek closed this as completed May 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention Issues where the author has responded to feedback. Needs: Triage 🔍 Platform: iOS iOS applications.
Projects
None yet
Development

No branches or pull requests

5 participants