Skip to content
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

Can't find node binary because we don't have $RN_DIR at version 0.65 #32168

Closed
listenzz opened this issue Sep 8, 2021 · 4 comments
Closed

Can't find node binary because we don't have $RN_DIR at version 0.65 #32168

listenzz opened this issue Sep 8, 2021 · 4 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@listenzz
Copy link
Contributor

listenzz commented Sep 8, 2021

Something wrong in react-native-xcode.sh.

Description

Can't find node binary because we don't have $RN_DIR definition in react-native-xcode.sh

React Native version:

0.65 or 0.65.1

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

# Find path to Node
# shellcheck source=/dev/null
source "$RN_DIR/scripts/find-node.sh"

# check and assign NODE_BINARY env
# shellcheck source=/dev/null
source "$REACT_NATIVE_DIR/scripts/node-binary.sh"

Replace $RN_DIR with $REACT_NATIVE_DIR, everything is OK.

@DanijelBojcic
Copy link

DanijelBojcic commented Sep 16, 2021

I had the same issue. I have updated react-native like a week ago, and it was working. Today ios build suddenly started to fail.

The problem is that $RN_DIR variable doesn't exist in node_modules/react-native/scripts/react-native-xcode.sh so it fails to read a path.

As a workaround you can add the following line to Build Phases-> Bundle React Native code and images:

export RN_DIR="$(cd "./node_modules/react-native" && pwd)" // <-- add this
./node_modules/react-native/scripts/react-native-xcode.sh

garethknowles added a commit to garethknowles/react-native that referenced this issue Sep 17, 2021
facebook-github-bot pushed a commit that referenced this issue Sep 17, 2021
Summary:
Fix the `find-node.sh` call in `react-native-xcode.sh` script

## Related issue
#32168

## Changelog

[iOS] [Fixed] - Fix for unable to find `find-node.sh` in `react-native-xcode.sh` script

Pull Request resolved: #32227

Test Plan: • Run an Xcode build which uses the `scripts/react-native-xcode.sh` in the JS Bundle build phase.

Reviewed By: TheSavior

Differential Revision: D31022043

Pulled By: GijsWeterings

fbshipit-source-id: 10aafd595c3a3a87c22f385ca4f61756f67e9b9d
@gabimoncha
Copy link

This worked for me too.
I've replaced $RN_DIR with $REACT_NATIVE_DIR and also removed export NODE_BINARY=node from Build Phases -> Bundle React Native code and images

@botevst
Copy link

botevst commented Oct 9, 2021

reac-native-xcode.patch

--- ./node_modules/react-native/scripts/react-native-xcode.sh	2021-10-09 02:10:24.000000000 +0200
+++ ./node_modules/react-native/scripts/react-native-xcode.sh	2021-10-09 02:32:09.000000000 +0200
@@ -81,7 +81,7 @@
 
 # Find path to Node
 # shellcheck source=/dev/null
-source "$RN_DIR/scripts/find-node.sh"
+source "$REACT_NATIVE_DIR/scripts/find-node.sh"
 
 # check and assign NODE_BINARY env
 # shellcheck source=/dev/null

lunaleaps pushed a commit that referenced this issue Oct 15, 2021
Summary:
Fix the `find-node.sh` call in `react-native-xcode.sh` script

## Related issue
#32168

## Changelog

[iOS] [Fixed] - Fix for unable to find `find-node.sh` in `react-native-xcode.sh` script

Pull Request resolved: #32227

Test Plan: • Run an Xcode build which uses the `scripts/react-native-xcode.sh` in the JS Bundle build phase.

Reviewed By: TheSavior

Differential Revision: D31022043

Pulled By: GijsWeterings

fbshipit-source-id: 10aafd595c3a3a87c22f385ca4f61756f67e9b9d
@stale
Copy link

stale bot commented Jan 9, 2022

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Jan 9, 2022
@listenzz listenzz closed this as completed Jan 9, 2022
@facebook facebook locked as resolved and limited conversation to collaborators Jan 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

4 participants