Cannot install any dart runtimes due to `failed to run install callback: exit status 2`
Here are reporduction steps and logs:
$ asdf --version
asdf version 0.18.0 (revision unknown)
$ asdf plugin remove dart && asdf plugin add dart && asdf install dart 3.9.4
Platform 'darwin' supported!
Version: 3.9.4
Install Path: /Users/exkazuu/.asdf/installs/dart/3.9.4
Platform: macos
Architecture: arm64
Downloading to temp directory asdf-dart.JOarGD
Include Extras: 0
Major Dart Version: 3
Checking if arm version exists...
https://storage.googleapis.com/dart-archive/channels/stable/release/3.9.4/sdk/dartsdk-macos-arm64-release.zip
Found arm version
Installing Dart SDK...
https://storage.googleapis.com/dart-archive/channels/stable/release/3.9.4/sdk/dartsdk-macos-arm64-release.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 205M 100 205M 0 0 3615k 0 0:00:58 0:00:58 --:--:-- 3981k
Unzipping Dart SDK to /Users/exkazuu/.asdf/installs/dart/3.9.4...
error installing version: failed to run install callback: exit status 2
Running into this issue as well trying to install any version of dart through asdf:
- asdf version: 0.18.0
- cpu: Apple M2 Pro
- OS: Tahoe 26.0.1
I was previously using a pre 0.16.0 version and I see that asdf is now on 0.18.0. I upgraded my own version following this upgrade guide:
https://asdf-vm.com/guide/upgrading-to-v0-16
Then I tried installing dart 3.9.4 and everything seemed to work. Coincidentally I'm also using an Apple M2. Can you confirm that you're either running a clean install of asdf or that you've upgraded asdf according to that guide? Does anything install from the dart plugin? If you try to install something else like golang, does that work?
I had the same issue:
asdf version: 0.18.0
cpu: Apple M1 Max
OS: Tahoe 26.0.1
It indeed does not install and shows error installing version: failed to run install callback: exit status 2 … I tried both 3.9.4 and 3.9.2
@PatOConnor43 I'm having the same issue but only for Dart. I've tried reinstalling an old version (3.9.0), but it is failing now too. I'm using 0.18.0 for a while and migrated it already. I've checked the docs again, but I've already set everything up correctly. My other asdf plugins are working fine.
I'm using an Apple M1 Pro with macOs 26.0.1 (25A362). Previously I've installed Dart with macOs 15 I think, not sure if this is important.
Assuming your output is the same as the original reporter, it looks like you're downloading the zipped file fine. The next step is unzipping the file: https://github.com/PatOConnor43/asdf-dart/blob/master/bin/install#L137
Do you have unzip available on your path?
Yes, I have unzip available. This is the output of unzip:
which unzip
/usr/bin/unzip
unzip -v
UnZip 6.00 of 20 April 2009, by Info-ZIP, with modifications by Apple Inc.
…
This is my output running asdf install dart 3.10.0
asdf install dart 3.10.0
Platform 'darwin' supported!
Version: 3.10.0
Install Path: /Users/huynh/.asdf/installs/dart/3.10.0
Platform: macos
Architecture: arm64
Downloading to temp directory asdf-dart.6BMYZu
Include Extras: 0
Major Dart Version: 3
Checking if arm version exists...
https://storage.googleapis.com/dart-archive/channels/stable/release/3.10.0/sdk/dartsdk-macos-arm64-release.zip
Found arm version
Installing Dart SDK...
https://storage.googleapis.com/dart-archive/channels/stable/release/3.10.0/sdk/dartsdk-macos-arm64-release.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 197M 100 197M 0 0 5894k 0 0:00:34 0:00:34 --:--:-- 6517k
Unzipping Dart SDK to /Users/huynh/.asdf/installs/dart/3.10.0...
error installing version: failed to run install callback: exit status 2
The temp directory is created correctly with the zip and I can even run the following:
unzip -d /Users/huynh/.asdf/installs/dart/3.10.0 asdf-dart.6BMYZu/sdk.zip > /dev/null 2>&1
Which outputs the dart-sdk directory correctly in my asdf directory and running asdf set --home dart latest and dart commands works fine after that.
If you need further information, please let me now.
The only other thing I could think of is trying to run the install script directly to see if there's any other useful output.
You should be able to find it in $ASDF_DATA_DIR/plugins/dart/bin/install. This is what you would run assuming you run this from your home directory:
ASDF_INSTALL_TYPE="version" ASDF_INSTALL_VERSION="3.10.0" ASDF_INSTALL_PATH="/Users/huynh/.asdf/installs/dart/3.10.0" .asdf/plugins/dart/bin/install
If the INSTALL_PATH doesn't exist you will need to create that first:
mkdir /Users/huynh/.asdf/installs/dart/3.10.0
If that works, I don't really know what else to try. Maybe restart your computer? 🤷
I've switched to https://github.com/mise-plugins/mise-dart and it works well. The diff is only https://github.com/PatOConnor43/asdf-dart/compare/master...mise-plugins:mise-dart:master so I suspect the root cause is https://github.com/mise-plugins/mise-dart/pull/2
Can you confirm that you're either running a clean install of asdf or that you've upgraded asdf according to that guide?
I'm running a clean install of asdf.
Does anything install from the dart plugin?
I cannot install anything.
If you try to install something else like golang, does that work?
$ asdf plugin list
bun
dart
dotnet
flutter
gcloud
ghc
golang
java
maven
nodejs
poetry
python
ruby
rust
tomcat
yarn
zig
Only the dart plugin doesn't work.
The only other thing I could think of is trying to run the install script directly to see if there's any other useful output.
You should be able to find it in
$ASDF_DATA_DIR/plugins/dart/bin/install. This is what you would run assuming you run this from your home directory:ASDF_INSTALL_TYPE="version" ASDF_INSTALL_VERSION="3.10.0" ASDF_INSTALL_PATH="/Users/huynh/.asdf/installs/dart/3.10.0" .asdf/plugins/dart/bin/installIf the INSTALL_PATH doesn't exist you will need to create that first:
mkdir /Users/huynh/.asdf/installs/dart/3.10.0If that works, I don't really know what else to try. Maybe restart your computer? 🤷
This also fails with:
Platform 'darwin' supported!
Version: 3.10.0
Install Path: /Users/huynh/.asdf/installs/dart/3.10.0
Platform: macos
Architecture: arm64
Downloading to temp directory asdf-dart.hSADuK
Include Extras: 0
Major Dart Version: 3
Checking if arm version exists...
https://storage.googleapis.com/dart-archive/channels/stable/release/3.10.0/sdk/dartsdk-macos-arm64-release.zip
Found arm version
Installing Dart SDK...
https://storage.googleapis.com/dart-archive/channels/stable/release/3.10.0/sdk/dartsdk-macos-arm64-release.zip
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 197M 100 197M 0 0 6259k 0 0:00:32 0:00:32 --:--:-- 6414k
Unzipping Dart SDK to /Users/huynh/.asdf/installs/dart/3.10.0...
Using https://github.com/mise-plugins/mise-dart as suggested by @exKAZUu works fine for me.