Xcode Using Wrong Node.js Path When Building React Native iOS App - Stack Overflow

I'm working on a React Native project, and when I try to build the app for the iOS emulator using

I'm working on a React Native project, and when I try to build the app for the iOS emulator using Xcode, I get the following error:

Node found at: /opt/homebrew/Cellar/node/23.4.0/bin/node
/Users/myusername/Library/Developer/Xcode/DerivedData/myprojectname-djumxyhefghbyxhakbfulqsiabcd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/hermes-engine.build/Script-46EB2E0002AE70.sh: line 9: /opt/homebrew/Cellar/node/23.4.0/bin/node: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code

Issue:

Xcode is referring to an outdated Node.js path (/opt/homebrew/Cellar/node/23.4.0/bin/node), but I have the correct version installed at:

/opt/homebrew/Cellar/node/23.10.0_1/bin/node

I also tried updating my xcode.env file with:

export NODE_BINARY=/opt/homebrew/Cellar/node/23.10.0_1/bin/node
  1. Running which node and node -v to verify that my terminal is using the correct Node.js version.

  2. Updating the Build Phases → Bundle React Native Code and Images script in Xcode to explicitly set the Node.js path:

export NODE_BINARY=/opt/homebrew/Cellar/node/23.10.0_1/bin/node
  1. Cleaning the build folder (Product > Clean Build Folder) and restarting Xcode.

  2. Checking ~/.zshrc and ~/.bashrc to ensure my shell environment is correctly configured.

How can I make sure Xcode consistently uses the correct Node.js path when building my React Native iOS app?

Any help would be appreciated!

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744109255a4558873.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信