我正在使用 React Native 0.64 安装一个包含多个模块的新项目。我可以轻松执行 pod install,但当我想运行我的应用程序(使用 react-native run-ios 或 XCode)时,在 XCode 上出现了以下错误:
/Users/thomas/Desktop/Dev/Mobile/appname/node_modules/react-native/scripts/generate-specs.sh: line 27: readlink: command not found
/Users/thomas/Desktop/Dev/Mobile/appname/node_modules/react-native/scripts/generate-specs.sh: line 27: dirname: command not found
/Users/thomas/Desktop/Dev/Mobile/appname/node_modules/react-native/scripts/generate-specs.sh: line 27: cd: : No such file or directory
Command PhaseScriptExecution failed with a nonzero exit code
关于 react-native run-ios 的这个问题:
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/thomas/Library/Developer/Xcode/DerivedData/appname-aqbmfgqjkshyqmaprdvggqaeqjrp/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/**FBReactNativeSpec**.build/Script-A319AA7F2B7AAE771AE63D66A0049241.sh
请注意,在我的node_modules/react-native文件夹中没有'scripts'文件夹(我只有assets、normalize-color和polyfills文件夹)。 我尝试过删除node-modules并重新安装,但没有解决问题。 我的规格如下:
iOS Big Sur v. 11.2.3
XCode v.12.3
React Native v.0.64
CocoaPods v. 1.10.1
Node v. 12.14.1
请帮忙看看,谢谢。