-
Notifications
You must be signed in to change notification settings - Fork 24.1k
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
Can't create bundle: react-native-xcode.sh fails to call react-native #3948
Comments
I have the same problem. |
as greyexpert's way,it works,but i still don't konw why…… |
Same here, thanks @greyexpert, now to find a real solution :) |
Experiencing the same issue... used @greyexpert workaround and was able to compile. Thanks |
@greyexpert work around worked for me as well. |
I had to add '/usr/local/bin' explicitly to ~/.bash_profile along w/ @greyexpert workaround |
+1 |
I created new project (react-native @0.14.0 and changing index.ios.js does not update in iOS simulator w/ Cmd+R. Anyone else experience this w/ this newest release? |
@bartonhammond I had to kill the initial packager that was started after |
For me, the Xcode build script failure as originally reported started after I upgraded a 0.13.2 project to 0.14.0. I then created a new 0.14.0 project from scratch, and it all worked. I took my original Here is the relevant bit of the build log from Xcode:
UPDATE I don't know if it's relevant, but I'm using lots of bleeding edge ES7 features. If that might be relevant to someone who understands the problem let me know and I'll post my |
argh - @samsalisbury that was it. thanks |
UPDATE: I have isolated the problem in my case to my Here's my
|
UPDATE: I've found a few things out:
The above I'm gonna see if I can live without that for now, and with RN's NOTE: Though all of the above the packager never once showed issues. |
UPDATE: Removing the |
Just realised my issue wasn't the same as the OP's, oops, I've been running on Node 4.2.1 rather than 5, and had a different error from the same script... |
==================== SOLUTION ==================== |
Thank you for the help @greyexpert That fix worked! |
Only adding source ~/.bash_profile was able to fix this for me. I didn't have a .babelrc at all, and this was a brand new project on the latest version of the react native tools. |
Thank you for the help @greyexpert that fix worked for me. |
@greyexpert great solution thanks. One thing to add: in my case it was not exactly |
It's a bad idea in general to source one's bash/zsh environment into any automation system. I've done a lot of work with highly repeatable automation environments (complex dev-to-production & devops VM environments, build systems, etc.), and nvm/rvm are an absolute plague there. Neither of those tools can run without a shell using their injected runtime functions as a proxy. This is outright impossible to do sanely and/or repeatably with many tools. Shell functions are absolutely the wrong means to this end. Instead, I use and highly recommend ndenv for node (and its namesake rbenv for Ruby users). ndenv manages node versions via a directory of shim scripts, HOWEVER: I get the same error using ndenv because <expletive deleted> Xcode 7.1 wholly overwrites a PATH set as a user-defined project setting. E.g. I can add a setting for PATH as This would allow for an easy and robust solution, but so far, I've been unable to determine whether there's any mechanism as of Xcode 7.1 that allows PATH to be augmented. 😞 |
For completeness, I've also inquired about the Xcode PATH behavior over on the Apple Developer Forums, but have yet to get any responses as of this writing. |
@vood your solution worked for me thanks! |
thanks, it really worked |
Why does And I assume you added that to Xcode based on the upgrading guide: https://facebook.github.io/react-native/docs/upgrading.html |
Yes, you can't use React Native without the CLI. See https://facebook.github.io/react-native/docs/getting-started.html#quick-start |
The documentation on upgrading says this at the bottom: If you installed Node via nvm, you might experience "react-native: command not found". See #3974 for workaround and #4015 for the fix. |
I was still having the problem because my nvm wasn't set to a default version. You can bootstrap it like this:
|
I've upgraded to version 0.16.0 but I'm still getting the error It's trying to run this file |
This isn't solved. I have been blocked from upgrading for a few because of this issue! |
Have you guys tried |
Does this happen always or only when building a release version from Xcode? Have little context here. Do you hit this when doing |
nvm version > ~/.nvmrc This helps, thanks @gre 👍 |
I have soloved this problem by this answer. |
+1 to @SunLn. node: 4.2.3 I'm not sure what it all means since I don't know the iOS environment very well. If there are any repercussions with this method moving forward I'd love to hear them so I can save myself any issues in the future. |
+1 to @SunLn 👍 |
+1 to @SunLn 👍, worked for me! |
@greyexpert how do you add source ~/.bash_profile to the beginning of react-native-xcode.sh (where do you find this) |
Hopefully the changes in #5518 will solve these problems once and for all. |
Well, the initial issue is about What do I miss, @mkonicek? |
#5518 has landed and we no longer depend on global |
Selected “Run Script only when installing”。like this http://stackoverflow.com/a/29211118 |
I recently updated node to 5.0.0 and react-native won't compile in Xcode. Previous projects still work though. Does anyone have any thoughts? Thank you!
../node_modules/react-native/packager/react-native-xcode.sh: line 36: react-native: command not found
Command /bin/sh failed with exit code 127
The text was updated successfully, but these errors were encountered: