-
Notifications
You must be signed in to change notification settings - Fork 24.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
find-node.sh supports Homebrew on M1 #31622
Conversation
@kelset should we cherry pick this to 0.64? |
Base commit: 118489f |
yeah that's a good idea, we need to get this merged first thought 😓 |
@hramos has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator. |
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes #31621 #31592 ## Changelog [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: #31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec # Conflicts: # scripts/find-node.sh
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes facebook#31621 facebook#31592 ## Changelog [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: facebook#31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes facebook#31621 facebook#31592 ## Changelog [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: facebook#31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec
@dulmandakh sadly this fix is incorrect when using nvm on m1. The order in find-node.sh is wrong. If you put the |
Sorry, I don't use nvm and have no experience, also didn't wanted to mess with someones setup. Please create a PR, I would be happy to review it. Thanks |
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes #31621 #31592 ## Changelog [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: #31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec
Summary: Adds homebrew on m1 to path before evaluating `command -v brew` to support nvm on m1 via homebrew. ## Changelog [General] [Changed] - Find node on m1 via homebrew node managers Pull Request resolved: #31678 Test Plan: On M1, use nvm via homebrew. Create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. cc: dulmandakh as discussed in #31622 Reviewed By: ShikaSD Differential Revision: D28967386 Pulled By: PeteTheHeat fbshipit-source-id: 3d4a41dd3cc25fbf77778b16468a236b141d1259
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes facebook#31621 facebook#31592 [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: facebook#31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec
Summary: Adds homebrew on m1 to path before evaluating `command -v brew` to support nvm on m1 via homebrew. ## Changelog [General] [Changed] - Find node on m1 via homebrew node managers Pull Request resolved: facebook#31678 Test Plan: On M1, use nvm via homebrew. Create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. cc: dulmandakh as discussed in facebook#31622 Reviewed By: ShikaSD Differential Revision: D28967386 Pulled By: PeteTheHeat fbshipit-source-id: 3d4a41dd3cc25fbf77778b16468a236b141d1259
Summary: Adds homebrew on m1 to path before evaluating `command -v brew` to support nvm on m1 via homebrew. ## Changelog [General] [Changed] - Find node on m1 via homebrew node managers Pull Request resolved: #31678 Test Plan: On M1, use nvm via homebrew. Create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. cc: dulmandakh as discussed in #31622 Reviewed By: ShikaSD Differential Revision: D28967386 Pulled By: PeteTheHeat fbshipit-source-id: 3d4a41dd3cc25fbf77778b16468a236b141d1259
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes facebook#31621 facebook#31592 ## Changelog [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: facebook#31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes facebook#31621 facebook#31592 [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: facebook#31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec
Summary: Adds homebrew on m1 to path before evaluating `command -v brew` to support nvm on m1 via homebrew. ## Changelog [General] [Changed] - Find node on m1 via homebrew node managers Pull Request resolved: facebook#31678 Test Plan: On M1, use nvm via homebrew. Create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. cc: dulmandakh as discussed in facebook#31622 Reviewed By: ShikaSD Differential Revision: D28967386 Pulled By: PeteTheHeat fbshipit-source-id: 3d4a41dd3cc25fbf77778b16468a236b141d1259
Summary: Homebrew on M1 installs executable binaries in **/opt/homebrew/bin** (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH. The way **react.gradle** trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS https://github.com/facebook/react-native/blob/d1ab03235cb4b93304150878d2b9057ab45bba77/scripts/react-native-xcode.sh#L106 Fixes facebook#31621 facebook#31592 [General] [Changed] - find-node.sh supports Homebrew on M1 Pull Request resolved: facebook#31622 Test Plan: On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. Reviewed By: ShikaSD Differential Revision: D28808206 Pulled By: hramos fbshipit-source-id: 8b313b6685462a15e67d99c61a0202d17fece1ec
Summary: Adds homebrew on m1 to path before evaluating `command -v brew` to support nvm on m1 via homebrew. ## Changelog [General] [Changed] - Find node on m1 via homebrew node managers Pull Request resolved: facebook#31678 Test Plan: On M1, use nvm via homebrew. Create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed. cc: dulmandakh as discussed in facebook#31622 Reviewed By: ShikaSD Differential Revision: D28967386 Pulled By: PeteTheHeat fbshipit-source-id: 3d4a41dd3cc25fbf77778b16468a236b141d1259
Summary
Homebrew on M1 installs executable binaries in /opt/homebrew/bin (See https://brew.sh/2021/02/05/homebrew-3.0.0/), and FBReactNativeSpec.build is failing because it couldn't find node. This PR changes find-node.sh script to add /opt/homebrew/bin into $PATH.
The way react.gradle trying to execute node is not using user environment variables, but system defaults, so it couldn't find it. I removed node execution, and hard coded cli path in parity with iOS
react-native/scripts/react-native-xcode.sh
Line 106 in d1ab032
Fixes #31621 #31592
Changelog
[General] [Changed] - find-node.sh supports Homebrew on M1
Test Plan
On M1, create a RN project and it'll fail to build iOS app. Apply the patch, and build will succeed.