Skip to content

React Native 0.64 is not following NODE_BINARY env setting in Xcode #31260

Description

@gnattu

Please provide all the information requested. Issues that do not follow this format are likely to stall.

Description

Previously, I could let RN to find node in non-standard location by specifying NODE_BINARY in Bundle React Native Code and images Build phase, but this stopped working after upgrade to RN 0.64 because generate-specs cannot find node.
Same setting was working well on RN 0.63.

React Native version:

System:
OS: macOS 11.2.3
CPU: (8) arm64 Apple M1
Memory: 106.17 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.11.0 - /opt/homebrew/bin/node
Yarn: 1.22.10 - ~/my_project/node_modules/.bin/yarn
npm: 7.6.0 - /opt/homebrew/bin/npm
Watchman: 4.9.0 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7042882
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 15.0.2 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.2 => 17.0.2 react-native: 0.64.0 => 0.64.0 react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found

Steps To Reproduce

Provide a detailed list of steps that reproduce the issue.

  1. Set export NODE_BINARY=/path/to/node in Bundle React Native Code and images in Xcode.
  2. Achieve the project, generate-specs will complain about node not found and build will fail.

Expected Results

The build should success as scripts should follow the NODE_BINARY setting.

Snack, code example, screenshot, or link to a repository:

PR #30781 stands out as it directly modifies how node is found in generate-specs.sh. Manually change NODE_BINARY in
generate-specs.sh to the path of node works around this problem, but it is dirty.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions