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
This commit is contained in:
Henrik Kok Jørgensen 2016-01-06 11:02:35 -08:00 committed by facebook-github-bot-6
parent 9e5dfbddbc
commit 85c016df31
1 changed files with 3 additions and 3 deletions

View File

@ -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 \