@sentry/cli binary doesn't download (leads to iOS build failure)
Environment os: macOS 12.6 platform: iOS yarn: 1.22.19 react: 17.0.2 react-native: 0.68.2
I created a new React-Native project by running npx react-native init AwesomeProject --version 0.68.0.
After that, I ran the following commands to install Sentry.
yarn add @sentry/react-native
npx @sentry/wizard -i reactNative -p ios android
cd ios
pod install
I have the following issue:
Android works well but I see the error while building the iOS app.
Command PhaseScriptExecution failed with a nonzero exit code
Error: spawn /AwesomeProject/node_modules/@sentry/cli/sentry-cli ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:477:16)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn /AwesomeProject/node_modules/@sentry/cli/sentry-cli',
path: '/Volumes/DATA/Project/AwesomeProject/node_modules/@sentry/cli/sentry-cli',
spawnargs: [ 'upload-dsym' ]
}
Command PhaseScriptExecution failed with a nonzero exit code
Hi, it looks like the path to the CLI executable is missing, probably it didn't download when installing dependencies.
You can try to reinstall dependencies or install the CLI manually by yarn add --dev @sentry/[email protected].
@krystofwoldrich Thank you for checking this! I confirmed @sentry/[email protected] was installed already. However, I ran the above and tried again but saw the same issue.
Here is a screenshot.

I see @sentry/cli but not @sentry/cli/sentry-cli. Is this a problem?
@krystofwoldrich @jeremyfalldev Same issue on my side. :(
@capella55 @jeremyfalldev For some reason the CLI install script didn't download the CLI binary or didn't get executed.
Try to execute it manually.
cd node_modules/@sentry/cli
node ./scripts/install.js
@krystofwoldrich Yes, it seems like the CLI install script does not work properly. Please check this screenshot.

It has been never completed 100% and I don't see sentry-cli.
Are you able to download the file from the URL manually?
https://downloads.sentry-cdn.com/sentry-cli/1.74.4/sentry-cli-Darwin-universal
@capella55 So the install.js never finishes?
@kamilogorek Do you know what could cause this?
@krystofwoldrich Yes, I can download the file from the URL manually. So the install.js never finishes. I've tried on several machines and see the same issue.
I tried to replicate the issue locally but with no luck. I see that your output is not TTY, as then it'd not print multiple progressbar lines (it shouldn't anyway as bar should be rendered in TTY environments only anyway ¯_(ツ)_/¯).
I wonder if it may have something to do with it. Can you try to run it with SENTRYCLI_NO_PROGRESS_BAR=1 instead?
Same issue using a yarn monorepo, running install.js manually fixes it.
@robgraeber Not exactly the same as for you the install.js finished when manually executed.
But anyway could you share what tools are you using, what OS, yarn version, node version...
Maybe some of it will help us to fix the issue.
Hmm I tried reproducing it in another repo but can't reliably. I also deleted my .yarn/cache folder in my original project and it seemed to reinstall successfully. I'm using yarn workspaces, yarn 3.2.1, node 16, and a mac.
Here's the repo of what I'm doing, it reproduced one time but doesn't happen when I try it again. https://github.com/robgraeber/sentry-test
@robgraeber Thanks for the repo I'll try it and let you know if I managed to reproduce it.
@robgraeber I'm sorry for the wait, sadly I still can't reproduce the issue. I've tried the repo with the same version of node and yarn, but no luck.
I will close this for now, as we are not able to reproduce the issue, if there would be some new context we could try feel free to inform us, and we can reopen the issue and continue with it.
In case some internet searcher comes along in the future...
I'm also using bun and I struggled with this for a while. I had the same issue where install.js was not being triggered and the sentry-cli rust executable was not present. This results in a file not found error in the spawn command which is very cryptic and confusing to debug until you dig into the repo a bit.
Not sure what precisely solved it for me, but it works now. Here's everything I did.
I moved @sentry/cli into dependencies from devDependencies and ensured that trustedDependencies listed it.
"trustedDependencies": [
"@sentry/cli"
]
Then these commands
bun upgrade
rm -rf ~/.bun/install/cache
rm -rf node_modules bun.lockb
@grossadamm Thank you for sharing this.