1

我想要一些帮助,让股票应用程序按照官方的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 env

$ 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
4

2 回答 2

4

原来我还没有从我的系统中完全删除 nvm。

rm -rf ~/.nvm

这解决了它。

于 2021-04-23T21:02:01.003 回答
0

似乎有点简单,您的解决方案可能是确保未设置 PREFIX 变量。

一种替代方法是通过 NVM 安装 Node,而不是在 ASDF 环境中管理 Node。我也使用 ASDF 环境,但我不将 ASDF 用于 python 或节点。对于那些,我管理 ASDF 之外的安装。

于 2021-04-23T20:38:12.933 回答