From c9e4d3488578d65e55198ad597252a2ac8cc5f73 Mon Sep 17 00:00:00 2001 From: Max Thirouin Date: Wed, 26 Jan 2022 07:39:36 -0800 Subject: [PATCH] - Support fnm when detecting node binary (#32890) Summary: Since 0.64, local code in `Bundle React Native code and images` step for iOS is not enough anymore. This add support for [fnm](https://github.com/Schniz/fnm) that is widely used this days. ## Changelog [General] [Added] - Support fnm when detecting node binary Pull Request resolved: https://github.com/facebook/react-native/pull/32890 Test Plan: I use fnm & it's working. Tested this code via patch-package. Reviewed By: christophpurrer Differential Revision: D33766842 Pulled By: cortinico fbshipit-source-id: 77bbda2c7742de9ec64e6faa9a3526d3997bb4aa --- scripts/find-node.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/find-node.sh b/scripts/find-node.sh index d300276dd98113..11338d0a5d383c 100755 --- a/scripts/find-node.sh +++ b/scripts/find-node.sh @@ -60,3 +60,10 @@ if [[ -x "$HOME/.volta/bin/node" ]]; then export VOLTA_HOME="$HOME/.volta" export PATH="$VOLTA_HOME/bin:$PATH" fi + +# Set up the fnm node version manager if present +if [[ -x "$HOME/.fnm/fnm" ]]; then + eval "$("$HOME/.fnm/fnm" env)" +elif [[ -x "$(command -v brew)" && -x "$(brew --prefix fnm)/bin/fnm" ]]; then + eval "$("$(brew --prefix fnm)/bin/fnm" env)" +fi