React native version: 0.67
Initialize and run the project according to the official document
$ npx react-native init AwesomeProject
$ yarn ios
The error message is as follows
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/zh/Library/Developer/Xcode/DerivedData/AwesomeProject-cvxgkvyxvvajjvaydcivldmzlgxr/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-5F4C70EF7D90A5A5BDAEB404279F232A.sh (in target 'FBReactNativeSpec' from project 'Pods') (1 failure)
Possible causes
- The project path contains white space characters
- NVM is used for node installation
I’m because of reason 2. The solution is to go to node_modules/react-native/scripts/find-node. SH
, comment out this part of the file
if [[ -s "$HOME/.nvm/nvm.sh" ]]; then
# shellcheck source=/dev/null
. "$HOME/.nvm/nvm.sh"
elif [[ -x "$(command -v brew)" && -s "$(brew --prefix nvm)/nvm.sh" ]]; then
# shellcheck source=/dev/null
. "$(brew --prefix nvm)/nvm.sh"
fi
Then execute yarn IOS
, and the execution will be successful
Similar Posts:
- Mac: How to Solve Print: Entry, “:CFBundleIdentifier”, Does Not Exist
- Using react native elements in RN project to report an error: unrecognized font family ‘material icons’
- How to Solve React-native-gesture-handler Error
- npm run build : No such file or directory [How to Solve]
- [Solved] React Project Start Error: Uncaught TypeError: Cannot read property ‘forEach‘ of undefined
- error [email protected]: The engine “node” is incompatible with this module.
- [Solved] React Native Error: A problem occurred configuring project ‘:app’. and Execution failed for t…
- How to Solve Stack error: eacces: permission denied, MKDIR
- React Run Error: Uncaught TypeError: Cannot read property ‘forEach‘ of undefined