I have a project in react native that I haven't worked on in a while. It was working fine last time I worked on it, but now when I try to build I get this error:
build target react-rncore /Users/[user]/Library/Mobile: No such file or directory
now I tried updating xcode, I tried to clean the build folder, I tried to delete derived data, I also tried to reinstall everything like so:
rm -rf node_modules/
npm install
cd ios/
rm -rf Pods/ Podfile.lock
pod install
but so far nothing seems to work.
here is some more info:
macos: 14.3.1, xcode: 15.2 15C500b, mac air m1 13
error log: Showing All Messages
Build target React-rncore of project Pods with configuration Debug
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/eliaelhadad/Library/Developer/Xcode/DerivedData/danoAesthetics-ddpibeemzkenrfdsrluevuazikkd/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/React-rncore.build/Script-46EB2E0003AA50.sh (in target 'React-rncore' from project 'Pods')
cd /Users/eliaelhadad/Library/Mobile\
/bin/sh: /Users/eliaelhadad/Library/Mobile: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
/Users/eliaelhadad/Library/Mobile: No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
there are multiple reasons for this error but in my case, it was node version.
there was node version mismatch in my system and the .xcode.env file.
There may by a file missing in ios folder named as ".xcode.env.local" that takes node version from your system .
Add export NODE_BINARY=/opt/homebrew/bin/node inside that file and re-run the app. Hope this works.
Oh well this work in the case if you installed node via homebrew , but incase not then you can update the path with the path from your node version using which node
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With