From a7596140e0a53372ce1a595045173f6d5547b8df 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 --- packager/react-native-xcode.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packager/react-native-xcode.sh b/packager/react-native-xcode.sh index b655222f222b7e..898862618acda1 100755 --- a/packager/react-native-xcode.sh +++ b/packager/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 \