I’m getting the following error in Xcode when building
Node found at: /opt/homebrew/bin/node
/Users/adamwright/Documents/Development/AB3MobileUpgrade/AB3MobileUpgrade/ios/Pods/../../node_modules/react-native/React/FBReactNativeSpec/../../scripts/react_native_pods_utils/script_phases.sh: line 34: /opt/homebrew/bin/node: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
It looks like my node is in the wrong path. if i do type node i get
node is /usr/local/bin/node
I tested on another machine also using homebrew and that path is opt/homebrew/bin/node where homebrew has installed it and the app builds!
How do I update the path to the homebrew default location so it’s correct?
2
Answers
in the ios folder is an .env file
The path in that just needed updating, it is an autogenerated file but i guess it screwed up.
The main issue was installing NodeJs by using homebrew, it would lose the main path of the NodeJs folder. This solution is a project’s local solution and maybe for another project which needs NodeJs, it would encounter the same issue.
NODE_BINARY
to your.zshrc
or.bashrc
file as a global environment variable and concat the/usr/local/bin/node
to your PATH system.nvm
install any NodeJs versions you wantWith the permanent solution you won’t encounter any issues ever