diff --git a/react-native-xcode.sh b/react-native-xcode.sh index 844788f1..dfa413b8 100755 --- a/react-native-xcode.sh +++ b/react-native-xcode.sh @@ -33,6 +33,15 @@ cd .. set -x DEST=$CONFIGURATION_BUILD_DIR/$UNLOCALIZED_RESOURCES_FOLDER_PATH +# Define NVM_DIR and source the nvm.sh setup script +[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm" + +if [[ -s "$HOME/.nvm/nvm.sh" ]]; then + . "$HOME/.nvm/nvm.sh" +elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then + . "$(brew --prefix nvm)/nvm.sh" +fi + react-native bundle \ --entry-file index.ios.js \ --platform ios \