MacOS安装Dart SDK

MacOS 使用 Homebrew 安装Dart SDK

安装

brew tap dart-lang/dart
brew install dart

如下:

~ brew tap dart-lang/dart
==> Tapping dart-lang/dart
Cloning into '/opt/homebrew/Library/Taps/dart-lang/homebrew-dart'...
remote: Enumerating objects: 2822, done.
remote: Counting objects: 100% (576/576), done.
remote: Compressing objects: 100% (183/183), done.
remote: Total 2822 (delta 516), reused 407 (delta 392), pack-reused 2246
Receiving objects: 100% (2822/2822), 520.76 KiB | 1.11 MiB/s, done.
Resolving deltas: 100% (1792/1792), done.
Tapped 18 formulae (47 files, 670.1KB).~ brew install dart
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
    arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.~ arch -arm64 brew install dart
==> Downloading https://storage.googleapis.com/dart-archive/channels/stable/release/2.17.1/sdk/dartsdk-macos-arm64-relea
######################################################################## 100.0%
==> Installing dart from dart-lang/dart
Warning: Your Xcode (13.2.1) is outdated.
Please update to Xcode 13.3 (or delete it).
Xcode can be updated from the App Store.

==> Caveats
Please note the path to the Dart SDK:
  /opt/homebrew/opt/dart/libexec
==> Summary
  /opt/homebrew/Cellar/dart/2.17.1: 918 files, 482.8MB, built in 6 seconds
==> Running `brew cleanup dart`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).~ 

M1 上 brew install dart ,使用 arch -arm64 brew install dart

Dart SDK 被安装到了 /opt/homebrew/opt/dart 路径下

更新

brew upgrade dart

如下:

~ brew upgrade dart
Error: Cannot install under Rosetta 2 in ARM default prefix (/opt/homebrew)!
To rerun under ARM use:
    arch -arm64 brew install ...
To install under x86_64, install Homebrew into /usr/local.

使用 arch -arm64 brew install dart 即可

你可能感兴趣的:(Dart,macos,dart,Dart,SDK)