Last active
June 24, 2025 15:19
-
-
Save joeyfigaro/245ce9c5bf7b34fadf5406e960f146e5 to your computer and use it in GitHub Desktop.
ensure `NODE_BINARY` exists during Xcode build time
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# From discussion in schniz/fnm | |
# https://github.com/Schniz/fnm/issues/475#issuecomment-2672700307 | |
# original author @erkie (https://github.com/erkie) | |
# No node? Try to load via fnm | |
if ! command -v node &> /dev/null; then | |
output=$(zsh -l -c 'source ~/.profile; source ~/.zshrc; eval "$(fnm env --shell=zsh)" && fnm env') | |
eval "$output" | |
# if no node is found throw an error | |
if ! command -v node &> /dev/null; then | |
echo "Node could not be found: $SHELL $USER $HOME" | |
exit 1 | |
fi | |
fi | |
export NODE_BINARY="$(realpath $(which node))" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment