You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
with-environment.sh does not work properly with .xcode.env #42804
The purpuse of xcode.env is to export your own node executable path without messing with the build script.
This does not work properly when using NVM, due to with-environment.sh trying to call node -v prematurely.
with-environment.sh crashes at line 16 because there is no node executable to be found before nvm.sh is sourced.
# Start with a default
NODE_BINARY=$(command -v node). # this is line 16
If xcode.env is used correctly with NVM, nvm.sh should be sourced in this file before the call to node -v. Unfortunately, xcode.env itself is sourced after line 16 in with-environment.sh, which is too late. Line 16 isn't even needed since the same call is performed in xcode.env.
Workaround:
Remove line 16 in with-environment.sh.
# Start with a default
#NODE_BINARY=$(command -v node)
I suggest that the premature call to node from within with-environment is removed so the nicely separated xcode.env can do it's thing.
Steps to reproduce
Install NVM
Update xcode.env as per the commented instructions
Build from XCode
React Native Version
0.73.3
Affected Platforms
Build - MacOS
Output of npx react-native info
not needed
Stacktrace or Logs
+++ command -v node
++ NODE_BINARY=
Command PhaseScriptExecution failed with a nonzero exit code
Will this issue be disregarded because I don't have a "Reproducible Example"?
I have exactly pinpointed a problem at line 16 in a bash file. What more can I do?
Ah, ok.
I thought you meant backported to 0.73.3 and it would be automatically picked for the next release. I think this should be picked ASAP in order to minimize the hazzle for people encountering this. I'll leave a comment in the release-conversation.
Reacted by Nicola Corti, Niklas Lillqvist and EasonHeee
Activity
github-actions commentedon Feb 2, 2024
msageryd commentedon Feb 2, 2024
Will this issue be disregarded because I don't have a "Reproducible Example"?
I have exactly pinpointed a problem at line 16 in a bash file. What more can I do?
cortinico commentedon Feb 2, 2024
Already fixed by:
with-environment.shscript #42184If you wish to have this backported to 0.73, please comment on the relevant discussion on https://github.com/reactwg/react-native-releases/
msageryd commentedon Feb 2, 2024
Great thanks!
I searched in issues, but didn't find any on this. Hence my post.
msageryd commentedon Feb 6, 2024
I didn't get a fixed with-environment.sh with my upgrade to 0.73.4. Was this patch omitted when picking patches for 0.73.4?
No big deal for me. I just want to understand how releases and patch-picking works.
cortinico commentedon Feb 6, 2024
This pick in only on main.
As I said, if you want this pick to be picked on the future 0.73.x, head over to https://github.com/reactwg/react-native-releases/ and comment on the relevant conversation
msageryd commentedon Feb 6, 2024
Ah, ok.
I thought you meant backported to 0.73.3 and it would be automatically picked for the next release. I think this should be picked ASAP in order to minimize the hazzle for people encountering this. I'll leave a comment in the release-conversation.
bheftyes commentedon Mar 18, 2024
@msageryd what is your .xcode.env looking like? I can't seem to be able to get nvm to work.
msageryd commentedon Mar 18, 2024
@bheftyes I haven't revisited this since I solved the problem brute-force. Currently I have hardcoded my Node path.
zhouhao27 commentedon Dec 19, 2024
I still got this issue in 0.76.1. My Xcode version is 16.1. Any idea?