Asdf: "No version set for command" has unhelpful error message

Created on 28 Feb 2020  路  10Comments  路  Source: asdf-vm/asdf

When .tool-versions is updated, asdf should tell users to run asdf install to get the new version of the tool. Instead, it tells users to edit .tool-versions back to the old value.

This causes endless confusion at my org, where every time we bump tool versions it tells all engineers to do precisely the wrong thing.

Steps to reproduce

  1. Make a .tool-versions with nodejs 10.15.3
  2. asdf install
  3. Edit .tool-versions to upgrade to nodejs 10.19.0
  4. node

Expected behavior

It should encourage the user to run asdf install, showing a message like this:

asdf: No version set for command node
asdf is configured to run

nodejs 10.19.0

However only these versions are installed

nodejs 10.15.3
nodejs 9.11.1
nodejs 8.11.2
nodejs 11.12.0

To install the new version, run:

    asdf install

Actual behavior

It encourages the user to undo the change to .tool-versions:

asdf: No version set for command node
you might want to add one of the following in your .tool-versions file:

nodejs 10.15.3
nodejs 9.11.1
nodejs 8.11.2
nodejs 11.12.0

Environment

OS: Mac OS X

asdf version: v0.7.6-6207e42

bug enhancement help wanted

Most helpful comment

@bmalehorn I'm going to close this as a fix seems to be in place. Feel free to re-open should you disagree 馃檪

All 10 comments

Related to #557

A PR to fix this would be welcome!

Looked into this. It looks like on the latest master, it already has an improved error message:

node
asdf: No preset version installed for command node
Please install the missing version by running one of the following:

asdf install nodejs 10.19.0

or add one of the following in your .tool-versions file:

nodejs 10.15.3
nodejs 9.11.1
nodejs 8.11.2
nodejs 11.12.0

...so I think this will be fixed when v0.7.7 is released.

Just came across this. Gives a decent error message now, which more or less fills the suggestion in OP.

@bmalehorn I'm going to close this as a fix seems to be in place. Feel free to re-open should you disagree 馃檪

Interesting, I

I may be seeing something related, but not quite? I commented about it here, will add the same comment here for completeness.

Have any of you seen this before and know how to fix this? Thank you in advance.


Hi! I'm on OSX (Mojave 10.14.6) and ran into the following:

~ :> asdf version
v0.7.8-4a3e3d6
~ :> asdf current
elixir         1.9.4    (set by /Users/pdg/.tool-versions)
erlang         22.3.4.1 (set by /Users/pdg/.tool-versions)
~ :> asdf reshim
~ :> cat .tool-versions
erlang 22.3.4.1
elixir 1.9.4
~ :> iex
asdf: No preset version installed for command erl
Please install the missing version by running one of the following:

asdf install erlang 22.3.4.1

or add one of the following in your .tool-versions file:

erlang 22.0.7
erlang 22.2.8
~ :> asdf install erlang 22.3.4.1
erlang 22.3.4.1 is already installed
~ :> rm .tool-versions
~ :> echo "erlang 22.2.8
> elixir 1.9.4" > .tool-versions
~ :> cat .tool-versions
erlang 22.2.8
elixir 1.9.4
~ :> iex
Erlang/OTP 22 [erts-10.6.4] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [hipe]

Interactive Elixir (1.9.4) - press Ctrl+C to exit (type h() ENTER for help)
iex(1)>
BREAK: (a)bort (c)ontinue (p)roc info (i)nfo (l)oaded
       (v)ersion (k)ill (D)b-tables (d)istribution
^C~ :>

Does anyone know how I can set the correct version on .tool-versions?

> asdf install erlang 22.3.4.1
erlang 22.3.4.1 is already installed

It looks like asdf thinks Erlang 22.3.4.1 is already installed. Perhaps try running asdf reshim and see if that fixes it? If not then try uninstalling and reinstalling (asdf uninstall erlang 22.3.4.1 and then asdf install erlang 22.3.4.1).

@Stratus3D thanks for the quick reply! Let's give that a go:

  • reshim did not do it
  • uninstall, setting the env vars correctly and then installing did!

I think what happened was a "bad" install somehow. In my case, I had forgotten the a specific plugin env var (the Erlang one, export KERL_CONFIGURE_OPTIONS="--disable-debug --without-javac") before doing the install step. Then, when I realized I forgot it, I control+C'ed, added it, and continued with the process. I think stopping it as it was doing its thing was the problem. I believe I should have uninstalled it (if it would even be possible at the time) and then installed it again. I think this may have been the root cause.

Thank you!

This seems vaguely similar to https://github.com/asdf-vm/asdf-erlang/issues/111. Contributions welcome if you want to work on that @pdgonzalez872 !

Interesting, I'll take a look at some point @Stratus3D. Not sure when, but I will :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

peleteiro picture peleteiro  路  3Comments

jamesstidard picture jamesstidard  路  4Comments

Quintasan picture Quintasan  路  5Comments

tomsquest picture tomsquest  路  4Comments

pachun picture pachun  路  3Comments