From 0bdffc690f11bee7cd798c8361be2e24758754fe Mon Sep 17 00:00:00 2001 From: Kevin Gozali Date: Fri, 1 Oct 2021 09:55:39 -0700 Subject: [PATCH] OSS: install node via nvm on iOS image (#32309) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/32309 With the iOS image using Xcode 13, the Circle CI guide mentioned to use `nvm` to manage node: https://circleci.com/docs/2.0/testing-ios/#images-using-xcode-13-and-later. Note: doing this here also helps with Xcode build scripts that needs to invoke this line: https://github.com/facebook/react-native/blob/main/scripts/find-node.sh#L27. For some reason, with Xcode 13 Circle CI image, without explicitly sourcing find-node.sh beforehand, react-native-codegen script phase within Xcode would fail (permission denied), like: https://app.circleci.com/pipelines/github/facebook/react-native/10525/workflows/b68b10a3-325a-4892-8252-baed9017c613/jobs/219615 Changelog: [Internal] Reviewed By: cortinico Differential Revision: D31331905 fbshipit-source-id: ebef055827c5276d812354eedece641740144b9b --- .circleci/config.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 70cb95c97e6c..5bcebf7b8215 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -370,14 +370,18 @@ jobs: steps: - brew_install: package: watchman - - brew_install: - package: node@12 - run: name: "Brew: Tap wix/brew" command: HOMEBREW_NO_AUTO_UPDATE=1 brew tap wix/brew >/dev/null - brew_install: package: applesimutils + - run: + name: Configure Node + # Sourcing find-node.sh will ensure nvm is set up. + # It also helps future invocation of find-node.sh prevent permission issue with nvm.sh. + command: source scripts/find-node.sh && nvm install 12 && nvm alias default 12 + - run: name: Configure Watchman command: echo "{}" > .watchmanconfig