Skip to content

Instantly share code, notes, and snippets.

@gusreyes01
Last active April 29, 2024 17:37
Show Gist options
  • Save gusreyes01/48c867bc68d386962b1129154c3fe7fc to your computer and use it in GitHub Desktop.
Save gusreyes01/48c867bc68d386962b1129154c3fe7fc to your computer and use it in GitHub Desktop.
# Setup NVM environment
[ -z "$NVM_DIR" ] && export NVM_DIR="$HOME/.nvm"
# Source the NVM script based on the installation path
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
# Ensure Node 16 is installed
nvm install 16
nvm use 16
# Update NODE_BINARY to use the nvm managed node version
export NODE_BINARY="node"
export NODE_OPTIONS=--openssl-legacy-provider
# Fix node binary permissions and copy to user bin directory if necessary
n=$(which node); n=${n%/bin/node}; chmod -R 755 $n/bin/*; sudo cp -r $n/{bin,lib,share} /usr/local
# Run react-native-xcode.sh script
../node_modules/react-native/scripts/react-native-xcode.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment