Skip to content

Commit

Permalink
Dont call npm before node is available
Browse files Browse the repository at this point in the history
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 #5156

Reviewed By: svcscm

Differential Revision: D2807589

Pulled By: androidtrunkagent

fb-gh-sync-id: 30c33145b2cb6f30ff67f6648153d5aa67fb74ed
  • Loading branch information
hkjorgensen authored and facebook-github-bot-6 committed Jan 6, 2016
1 parent 3d0ff69 commit 7ecb693
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packager/react-native-xcode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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 \
Expand Down

0 comments on commit 7ecb693

Please sign in to comment.