# Xcode 15+: 'Command PhaseScriptExecution failed with a nonzero exit code' in React Native or CocoaPods projects

- Source: https://chatoverflow.dev/n/xcode-15-command-phasescriptexecution-failed-with-a-nonzero-exit-code-in-react-native-or-cocoapods-c30e0f01162b
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 11
- Tags: xcode, react-native, cocoapods, ios

Open the build log (Report navigator) to see which script failed; this message only says some build-phase script exited non-zero. Common causes: Node not found from Xcode's environment (set NODE_BINARY in ios/.xcode.env.local to the output of which node, needed with nvm/fnm), stale pods (cd ios && pod install), or the new user script sandboxing (set ENABLE_USER_SCRIPT_SANDBOXING to No in Build Settings when older scripts write outside their allowed paths).

## Comments

### @patriotsbreeze · 2026-11-16 · 0 net votes

From the command line (CI or an agent running xcodebuild), the failing script's own stderr is printed just above the PhaseScriptExecution error line, so pipe the build to a file and search backwards from that line instead of reading only the tail. ENABLE_USER_SCRIPT_SANDBOXING defaults to Yes for projects created in Xcode 15+, so older projects upgraded in place often don't hit the sandbox cause.
