Stock React Native 应用程序不会基于 iOS(asdf?)
Stock React Native app won't build on iOS (asdf?)
我需要一些帮助来获取股票应用程序 运行ning 关注官方 Getting Started。
我下载了 iOS 模拟器 14.3。
我运行
npx react-native init nuproject
cd nuproject
npx react-native run-ios
我明白了
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/me/Library/Developer/Xcode/DerivedData/nuproject-enujsutisqszfkeohcvaepmqnist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-C635E97B268646534DBB9F9667109A6E.sh
(1 failure)
这是我的 react-native 环境,如果它可以帮助的话
$ npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 11.2.3
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Memory: 80.10 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.8.0 - ~/.asdf/installs/nodejs/15.8.0/bin/node
Yarn: 1.22.10 - ~/.asdf/installs/nodejs/15.8.0/.npm/bin/yarn
npm: 7.5.1 - ~/.asdf/installs/nodejs/15.8.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 29
Build Tools: 28.0.3, 29.0.2, 29.0.3
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7199119
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242 - /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
看起来有点简单,您的解决方案可能是确保未设置 PREFIX 变量。
您可以选择的一种方法是通过 NVM 安装 Node,而不是在 ASDF 环境中管理 Node。我也使用 ASDF 环境,但我不将 ASDF 用于 python 或节点。对于那些,我管理 ASDF 之外的安装。
原来我还没有从我的系统中完全删除 nvm。
rm -rf ~/.nvm
然后就解决了。
我需要一些帮助来获取股票应用程序 运行ning 关注官方 Getting Started。
我下载了 iOS 模拟器 14.3。
我运行
npx react-native init nuproject
cd nuproject
npx react-native run-ios
我明白了
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/me/Library/Developer/Xcode/DerivedData/nuproject-enujsutisqszfkeohcvaepmqnist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-C635E97B268646534DBB9F9667109A6E.sh
(1 failure)
这是我的 react-native 环境,如果它可以帮助的话
$ npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 11.2.3
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU @ 2.50GHz
Memory: 80.10 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.8.0 - ~/.asdf/installs/nodejs/15.8.0/bin/node
Yarn: 1.22.10 - ~/.asdf/installs/nodejs/15.8.0/.npm/bin/yarn
npm: 7.5.1 - ~/.asdf/installs/nodejs/15.8.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 29
Build Tools: 28.0.3, 29.0.2, 29.0.3
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7199119
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242 - /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
看起来有点简单,您的解决方案可能是确保未设置 PREFIX 变量。
您可以选择的一种方法是通过 NVM 安装 Node,而不是在 ASDF 环境中管理 Node。我也使用 ASDF 环境,但我不将 ASDF 用于 python 或节点。对于那些,我管理 ASDF 之外的安装。
原来我还没有从我的系统中完全删除 nvm。
rm -rf ~/.nvm
然后就解决了。