sentry-react-native: sentry-cli : no such file or directory while building in Xcode
OS:
- Windows
- [*] MacOS
- Linux
Platform:
- [*] iOS
- Android
SDK:
- [*]
@sentry/react-native(>= 1.0.0) -
react-native-sentry(<= 0.43.2)
SDK version: 3.2.13
react-native version: 0.67.2
Are you using Expo?
- Yes
- [*] No
Are you using sentry.io or on-premise?
- sentry.io (SaaS)
- [*] on-premise
Configuration:
(@sentry/react-native)
Sentry.init({
dsn: 'https://...@sentry.io/...'
// other options
});
I have following issue:
Xcode’s “Bundle React native code and images” not able to find sentry-cli file. Give PhaseScriptExecution error: env: node: no such file or directory
Steps to reproduce:
- brew install node
- install sentry in react native project
- run sentry wizard
- build project in Xcode
Actual result:
PhaseScriptExecution error: env: node: no such file or directory
Expected result:
Build to be succeeded.
I am not using nvm. There is no nvm in my machine. when I run nvm command it says command not found
when I run which node it gives /opt/homebrew/bin/node
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 19 (7 by maintainers)
I’m getting the same error on both, fresh project RN 0.67 and old project RN 0.66. Started a new project just to see which package was causing it, only sentry causes this error 😦 On a Mac M1.
Hi guys, I solved this problem finally. All you have to do is write this code in the terminal
Then write this
$ ln -s /opt/homebrew/Cellar/node@14/14.17.6/bin/node /usr/local/bin/nodeit worked after i did it. I hope it works for you too 🙏
Also, this is where I followed. https://docs.sentry.io/platforms/react-native/manual-setup/manual-setup/#using-node-with-nvm-or-volta
@marandaneto I think you got it wrong? This is not about the cli, it’s about Xcode not able to find the “sentry-cli” script file in the @sentry/react-native package, while building. env: node: no such file or directory - …/node_modules/@sentry/cli/bin/sentry-cli
Faced the same issue when trying to set up sentry with nvm. Ended up adding the following workaround to the build phase scripts
I am getting the same response even when running sentry-cli directly not through Xcode. We had working CI setup for a long time, but now it stopped working (2 days ago).
Directory exists. Running on: Ubuntu LTS
The only possible issue now then is that you are running
bashorzshinterpreter inside your terminal, where XCode is running scripts thoughshitself. In this case, you need to either:PATHoverrides from.bashrc(or.zshrcif usingzsh) to.profile/bin/bash,/usr/local/bin/zshor whatever interpreter you are usingNo, we have arm builds for M1. The issue here appears to be npm configured to not run post-install scripts, which then skips fetching of cli. You can confirm that by going into
node_modules/@sentry/cliand running./scripts/install.js.It should be a macOS m1 then, I just ran again on a normal macOS and it works.
@kamilogorek or @AbhiPrasad are you aware of any issues on Sentry Wizard or Sentry CLI (latest versions) on macOS m1?
@akshitrcrm That works for me on a fresh project, likely something with your environment? Try to install it standalone? https://docs.sentry.io/product/cli/installation/#installation-via-npm