Skip to content

Commit 7658440

Browse files
liamjonesfacebook-github-bot
authored andcommitted
Add volta support to find-node.sh (#32611)
Summary: This PR add [volta](https://volta.sh/) support to find-node.sh for use by `scripts/react-native-xcode.sh`, `scripts/generate-specs.sh`, etc. ## Changelog [iOS] [Added] - add volta support to find-node.sh Pull Request resolved: #32611 Test Plan: Manually tested with volta installed node (and [relevant change](https://docs.volta.sh/guide/understanding#managing-your-project) added to the project's package.json). Without this patch, the `Bundle React Native code and images` Build Phase fails, with it, it succeeds. Tested with both `curl https://get.volta.sh | bash` installed and `brew install volta`. One check works for both because the `node` shim will always be installed to the same location (and the required environment variable exports are the same also) Wasn't sure if you'd want the package.json change applied to rn-tester? Shouldn't affect people who don't use volta. Shout if you want me to add it to this PR. Reviewed By: cortinico Differential Revision: D32498267 Pulled By: yungsters fbshipit-source-id: 93ee187bd2178bfcd8f9009a1a0668c6f5583aa3
1 parent 6b1ccef commit 7658440

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

scripts/find-node.sh

+6
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,9 @@ elif [[ -x "$(command -v brew)" && -f "$(brew --prefix asdf)/asdf.sh" ]]; then
5050
# shellcheck source=/dev/null
5151
. "$(brew --prefix asdf)/asdf.sh"
5252
fi
53+
54+
# Set up volta if present
55+
if [[ -x "$HOME/.volta/bin/node" ]]; then
56+
export VOLTA_HOME="$HOME/.volta"
57+
export PATH="$VOLTA_HOME/bin:$PATH"
58+
fi

0 commit comments

Comments
 (0)