Skip to content

Commit 7ecb693

Browse files
hkjorgensenfacebook-github-bot-6
authored andcommitted
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 #5156 Reviewed By: svcscm Differential Revision: D2807589 Pulled By: androidtrunkagent fb-gh-sync-id: 30c33145b2cb6f30ff67f6648153d5aa67fb74ed
1 parent 3d0ff69 commit 7ecb693

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

packager/react-native-xcode.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ cd ..
2929
set -x
3030
DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH
3131

32-
# npm global install path may be a non-standard location
33-
PATH="$(npm prefix -g)/bin:$PATH"
34-
3532
# Define NVM_DIR and source the nvm.sh setup script
3633
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
3734

@@ -46,6 +43,9 @@ if [[ -x "$HOME/.nodenv/bin/nodenv" ]]; then
4643
eval "$($HOME/.nodenv/bin/nodenv init -)"
4744
fi
4845

46+
# npm global install path may be a non-standard location
47+
PATH="$(npm prefix -g)/bin:$PATH"
48+
4949
react-native bundle \
5050
--entry-file index.ios.js \
5151
--platform ios \

0 commit comments

Comments
 (0)