Summary:
Hello!
I'm a fan of the *env family of version managers over the *vm family as I find them simpler and less obtrusive, but it seems that they don't currently work so well with react-native on OSX. See #4645
I've made a small addition to the xcode script that resolves the issue for me. Hopefully others will find this useful too :)
If I've not made the right move here, what is the correct way to get react-native projects building in xcode when the binary is not in the $PATH used by the script?
Cheers,
Louis
Closes https://github.com/facebook/react-native/pull/4801
Reviewed By: svcscm
Differential Revision: D2770726
Pulled By: androidtrunkagent
fb-gh-sync-id: 3b0f9e466549b3012a68c94738d2556173f4c21e
Summary:
Related to issue https://github.com/facebook/react-native/issues/4034#issuecomment-164134543.
The npm global install path may be set to a non-standard location. `react-native` is assumed to be in `PATH` but doesn't take into account the user's environment so building in Xcode fails:
~~~
react-native bundle --entry-file index.ios.js --platform ios --dev true --bundle-output [...]
../node_modules/react-native/packager/react-native-xcode.sh: line 48: react-native: command not found
Command /bin/sh failed with exit code 127
~~~
This fix uses `npm prefix -g` to get the bin location and adds it to `PATH`.
Closes https://github.com/facebook/react-native/pull/4749
Reviewed By: svcscm
Differential Revision: D2753215
Pulled By: androidtrunkagent
fb-gh-sync-id: 964d1a71ac1bf204545a594a9fa433a7bc367f35
Summary: When Node is installed with nvm, scripts invoked from Xcode need to set up nvm. This can be done either by sourcing .profile/.bash_profile/.bashrc/etc... or by sourcing nvm.sh directly -- this diff does the latter and handles the case where nvm may have been installed the official way (under ~/.nvm/nvm.sh AFAIK) or via homebrew.
Closes https://github.com/facebook/react-native/pull/4015
Reviewed By: svcscm
Differential Revision: D2633301
Pulled By: frantic
fb-gh-sync-id: 3c2b9b0d21887ba21d6f85f5d279314d50c1db28