0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

MacでDart SDKをバージョン指定してインストールする

Posted at

動機

依存ライブラリのバージョンによって、最新バージョンのDart SDKを使えない場合がある。
公式の手順だと、$ brew switchでバージョンを変更する方法が紹介されているが、入れたいバージョンのSDKが公開されていなかったため、手作業をインストールすることになった。

手順

(1) ZIP形式でSDKをダウンロードする

好きなバージョンのSDKをZIPでダウンロードします。
https://dart.dev/tools/sdk/archive

(2) 任意のディレクトリに配置し、パスを通す

ZIPを解凍して、適当なディレクトリに置いてパスを通します。
今回は/optに配備します。

$ mv ~/Downloads/dart-sdk /opt/dart-sdk
$ echo export PATH='/opt/dart-sdk/bin:$PATH' >> ~/.zshrc

(3) ※任意 webdevのインストール

ここまでの手順で任意バージョンのSDKはインストールできましたが、ついでにwebdevも入れましょう。
pubコマンドで好きなバージョンのwebdevを入れられます。

$ pub global activate webdev 2.6.2
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?