From 85c016df312aa75512a9c45841d5d84d99ccffb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Kok=20J=C3=B8rgensen?= Date: Wed, 6 Jan 2016 11:02:35 -0800 Subject: [PATCH] Dont call npm before node is available Summary: This fixes an error introduced in `0.18.0-rc` `node` and `npm` isn't available if the developer is using `nvm` or `nodeenv`. XCode throws an error because of the call to `npm`. Simple move the line to after `node` and `npm` has been setup. Closes https://github.com/facebook/react-native/pull/5156 Reviewed By: svcscm Differential Revision: D2807589 Pulled By: androidtrunkagent fb-gh-sync-id: 30c33145b2cb6f30ff67f6648153d5aa67fb74ed --- react-native-xcode.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/react-native-xcode.sh b/react-native-xcode.sh index b655222f..89886261 100755 --- a/react-native-xcode.sh +++ b/react-native-xcode.sh @@ -29,9 +29,6 @@ cd .. set -x DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH -# npm global install path may be a non-standard location -PATH="$(npm prefix -g)/bin:$PATH" - # Define NVM_DIR and source the nvm.sh setup script [ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm" @@ -46,6 +43,9 @@ if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then eval "$($HOME/.nodenv/bin/nodenv init -)" fi +# npm global install path may be a non-standard location +PATH="$(npm prefix -g)/bin:$PATH" + react-native bundle \ --entry-file index.ios.js \ --platform ios \