Skip to content

Commit 0d82b40

Browse files
ulocofacebook-github-bot
authored andcommitted
Fix missing node error message not printed correctly (#36140)
Summary: When the node version could not be found there is an error message shown to help what can be done to fix this issue (for example in the error logs in xcode) The problem was that the backtick symbol is interpreted as running commands in terminals so the parts that were in backticks were run and the error message was printed incompletely. Also there were other errors added (.xcode.env command not found, for example) which makes it harder to understand what is going on. In bash / zsh single quotes does not expand commands and variables unlike double quotes which does this. ## Changelog [IOS] [FIXED] - Fix missing node error message not printed correctly when deprecated `find-node-for-xcode.sh` is used. Pull Request resolved: #36140 Test Plan: I just ran the xcode build again after updating it manually in the node_modules folder. The log output changed from this ``` [Warning] You need to configure your node path in the environment. You can set it up quickly by running: echo 'export NODE_BINARY=/Users/uloco/Library/Caches/fnm_multishells/78434_1676301546457/bin/node' > .xcode.env in the ios folder. This is needed by React Native to work correctly. We fallback to the DEPRECATED behavior of finding . This will be REMOVED in a future version. You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment ``` to this ``` [Warning] You need to configure your node path in the `".xcode.env" file` environment. You can set it up quickly by running: `echo export NODE_BINARY=$(command -v node) > .xcode.env` in the ios folder. This is needed by React Native to work correctly. We fallback to the DEPRECATED behavior of finding `node`. This will be REMOVED in a future version. You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment ``` Reviewed By: cortinico, cipolleschi Differential Revision: D43258623 Pulled By: rshest fbshipit-source-id: 7db0d983b204e59504666686be78311c4c2fb993
1 parent e45e718 commit 0d82b40

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

scripts/xcode/with-environment.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,12 @@ fi
3232
if [ -n "$NODE_BINARY" ]; then
3333
echo "Node found at: ${NODE_BINARY}"
3434
else
35-
echo "[Warning] You need to configure your node path in the `'.xcode.env' file` environment. " \
36-
"You can set it up quickly by running: " \
37-
"echo 'export NODE_BINARY=$(command -v node)' > .xcode.env " \
38-
"in the ios folder. This is needed by React Native to work correctly. " \
39-
"We fallback to the DEPRECATED behavior of finding `node`. This will be REMOVED in a future version. " \
40-
"You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment" >&2
35+
echo '[Warning] You need to configure your node path in the `".xcode.env" file` environment. ' \
36+
'You can set it up quickly by running: ' \
37+
'`echo export NODE_BINARY=$(command -v node) > .xcode.env` ' \
38+
'in the ios folder. This is needed by React Native to work correctly. ' \
39+
'We fallback to the DEPRECATED behavior of finding `node`. This will be REMOVED in a future version. ' \
40+
'You can read more about this here: https://reactnative.dev/docs/environment-setup#optional-configuring-your-environment' >&2
4141
source "${REACT_NATIVE_PATH}/scripts/find-node-for-xcode.sh"
4242
fi
4343

0 commit comments

Comments
 (0)