-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
New project not working on IOS Xcode 12.4 react-native 0.64 (Command PhaseScriptExecution failed with a nonzero exit code) #31181
Comments
I have the same problem.
System: |
Same issue for me as well!!! Any solutions?? I tried https://dev.to/glocore/react-native-command-phasescriptexecution-failed-of9, but no success! |
I'm also having trouble to start a new RN project. I've already tried to add a
|
In my case, the PhaseScriptExecution script was failing for this reason:
There seems to be a clash in the environment variables used by react native and nvm? I solved the issue by uninstalling nvm Also, make sure you don't have any spaces in the project path |
This happened also to me upgrading from 0.63 to 0.64. After trying all solutions with no luck, I found that moving the folder to a directory where the path contain no spaces works and build the app successfully. https://github.com/facebook/react-native/issues/31206 |
Per this article I used: |
It happened to me as well. You can check the error shell, try to run it via bash directly to check the shell problem. |
Hi all any update i want to try |
same here. cannot solve the issue and it shows command /bin/sh failed with exit code 11. |
I guess that's a solution 😄 Any workarounds without nuking |
Same issue here. Upgrading flipper doesn't change anything - also looking for a solution without uninstalling nvm. |
This only throws an Additionally the linked article explains how to install |
Interesting tidbit, when building via XCode it does not complain, compiles and installs on the simulator. |
Ok, this comment on another ticket resolved the issue for me:
|
Doesn't work for me. :/ Node: 12.18.4 |
I have figured out a solution, if you're using If you aren't sure whether or not you have a global version, go to your bash_profile/zshrc and comment the three In my case I'm using Homebrew, and I had a global version of Node that I wasn't even aware coming from the As for a proper resolution on the react-native repo, I suspect that the problem is somehow coming from find-node.sh which is a new file on 0.64. Can't really confirm or propose a solution though. cc @hramos |
Here what worked for me. I was using node version After that I installed node from official website with exact version |
This works for me!!!! |
After doing what @rdsedmundo suggested, I still didn't came by a fix so then I read the error logs a little closer and it suggested me to do: To replace Also CMD-Shift-K to clean the build folder (just to make sure), then build again, and everything worked fine. This method might come in handy for those who still want to keep This worked for me, hope it helps whomever stumbles across this problem. |
Work for me, thanks! |
it's work for me. Thank you |
OMG! Thank you so much. I've been pulling my hair out over this for 2 days. You rock! |
Thank you @bujoralexandru It's worked for me. |
Run it from CLI |
I'm totally dumbfounded! Something so friggin simple and obscure brought my work to a screeching halt for a day and a half! If I had any hair, I'd be pulling it out! For those as frustrated as I was, try this first. ☝🏻 |
This is resolved in the latest version of react-native (0.66.1) |
For those having this issue, I'm using NVM, I found the path of node I had active in NVM and symlinked it to /usr/local/bin/node. The other solutions above didn't work where you export NODE_BINARY etc. This fix is more of a workaround and will need to be adjusted over time / removed. Not ideal, but it works.
|
Summary: Some users have `node` installed globally which sets a `PREFIX` by default (so it knows where to put pkgs). We are looking for the "right" node on the next step anyway and if the user is using `nvm`, `PREFIX` breaks it. closes facebook#31181 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Ignores global npm prefix Pull Request resolved: facebook#31740 Test Plan: `yarn ios` now works, even if there's a `usr/local/bin/npm` <img width="493" alt="Screen Shot 2021-06-17 at 10 14 08 AM" src="https://user-images.githubusercontent.com/2659478/122413946-c2f57200-cf54-11eb-817c-bd3c07ac50bf.png"> Reviewed By: yungsters Differential Revision: D31237363 Pulled By: charlesbdudley fbshipit-source-id: 4ee9c04f8b8ab4e815bafbe2d02e589d621577b4
Summary: Some users have `node` installed globally which sets a `PREFIX` by default (so it knows where to put pkgs). We are looking for the "right" node on the next step anyway and if the user is using `nvm`, `PREFIX` breaks it. closes facebook#31181 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Ignores global npm prefix Pull Request resolved: facebook#31740 Test Plan: `yarn ios` now works, even if there's a `usr/local/bin/npm` <img width="493" alt="Screen Shot 2021-06-17 at 10 14 08 AM" src="https://user-images.githubusercontent.com/2659478/122413946-c2f57200-cf54-11eb-817c-bd3c07ac50bf.png"> Reviewed By: yungsters Differential Revision: D31237363 Pulled By: charlesbdudley fbshipit-source-id: 4ee9c04f8b8ab4e815bafbe2d02e589d621577b4
Hi @Yonom, Could you please help me? |
Fantastic and insightful comments here, which led to my solution. I'll add my specific solution to the pot: in my case, I also had brew uninstall nodenv But then I still had to do: rm -R /Users/myuser/.nodenv/ And even then I still had to manually remove this line in my
Whew, builds working again in XCode 😅 |
Updating nvm fixed it for me. |
removing |
Summary: Some users have `node` installed globally which sets a `PREFIX` by default (so it knows where to put pkgs). We are looking for the "right" node on the next step anyway and if the user is using `nvm`, `PREFIX` breaks it. closes facebook#31181 ## Changelog <!-- Help reviewers and the release process by writing your own changelog entry. For an example, see: https://github.com/facebook/react-native/wiki/Changelog --> [General] [Fixed] - Ignores global npm prefix Pull Request resolved: facebook#31740 Test Plan: `yarn ios` now works, even if there's a `usr/local/bin/npm` <img width="493" alt="Screen Shot 2021-06-17 at 10 14 08 AM" src="https://user-images.githubusercontent.com/2659478/122413946-c2f57200-cf54-11eb-817c-bd3c07ac50bf.png"> Reviewed By: yungsters Differential Revision: D31237363 Pulled By: charlesbdudley fbshipit-source-id: 4ee9c04f8b8ab4e815bafbe2d02e589d621577b4
i fixed it |
I did several things so it's hard to know which one did it:
Finally, my worked when doing these and running react-native 0.67.2. The newer version on it's own didn't fix it, I had to do at least one of these other assertions to get it working Things to consider:
I am running macOS Monterrey and Xcode 13.2.1, but I tried on BigSur and also Xcode 12.5.1 and the still got the error. |
In my case, re-installing nvm solved it. |
Thank you so much, this solved my problem! I have node (v16.14.0) installed via |
Thanks!
|
Thanks! |
Instead of removing nvm or removing nvm's default alias one could simple patch react-native's node_modules. Update if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
# shellcheck source=/dev/null
- . "$HOME/.nvm/nvm.sh"
+ . "$HOME/.nvm/nvm.sh" --no-use
+ nvm use 2> /dev/null || nvm use default
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
# shellcheck source=/dev/null
- . "$(brew --prefix nvm)/nvm.sh"
+ . "$(brew --prefix nvm)/nvm.sh" --no-use
+ nvm use 2> /dev/null || nvm use default
fi |
In a completely freshly initialized project generated via My Building via
Monterey 12.2.1 (21D62) |
@alancwoo did you install First remove cocoapods with If you're still having issues try I had issues with installing pods when using I am running the exact same setup: |
I ran into this failure too. I also debugged it down to the |
You saved my day |
Took me awhile but I ran the following and it now works 🥳 You could conceivably just run the last one... |
I just had a similar issue. I had previously had this issue and This time that approach did not fix it. I started to re-create the steps that were happening on that I ended up upgrading |
This solved for me using nvm and node 16.16.0 |
This truely worked for me.. Since I'm using M2 macbook pro and building the ios and android via fastlane, i encountered this issue and unsure what to do. I was looking out every where for the solution, finally I found this, based on that i realised that i've installed yarn via brew and not via npm. so uninstalling the yarn and re-installing via npm -g made a big difference. It made my day. Thanks for this Cheers, |
Please provide all the information requested. Issues that do not follow this format are likely to stall.
Description
i try to create a new project (npx react-native init TestApp --version 0.64.0 --template react-native-template-typescript). It fails with XCode 12.4
React Native version:
System:
OS: macOS 10.15.7
CPU: (8) x64 Intel(R) Core(TM) i7-3720QM CPU @ 2.60GHz
Memory: 78.82 MB / 16.00 GB
Shell: 3.1.2 - /usr/local/bin/fish
Binaries:
Node: 14.13.1 - /usr/local/bin/node
Yarn: 1.22.10 - /usr/local/bin/yarn
npm: 6.14.8 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 23, 28, 29
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2, 30.0.3
System Images: android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6953283
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_265 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
Expected Results
Run the base app
Snack, code example, screenshot, or link to a repository:
Error: Command PhaseScriptExecution failed with a nonzero exit code
The text was updated successfully, but these errors were encountered: