Description
Describe the bug
We get a number of bug reports around the error No preset version installed for command <CMD>
message. Some of the time the set version for the tool is not installed and this error message is correct. Other times it is not correct because the version is installed as required, but the plugin requires a reshim as a binary was installed using the tool and asdf
needs to create a shim for the new binary.
We see this with any tool that can install binaries through it's own package manager (Ruby, Golang, Node.js etc)
The most recent example is #914 is an example of this:
No preset version installed for command <golang binary>
Please install a version by running one of the following:
asdf install golang 1.16.2
or add one of the following versions in your config file at HOME/.tool-versions
golang 1.15.1
where the <golang binary>
was installed and used before reshimming the plugin (asdf reshim golang
).
To Reproduce
See #914
Expected behavior
As mentioned by OP in #914 (comment) the error message should notify the user to reshim when the specified version of the tool is installed.
Auto reshimming (#409 / #446) would resolve this class of errors. Notably, plugins can run the reshim themselves. The Node.js plugin uses the npm postinstall hook to run the reshim after installation (the Node package manager used must support the npm hooks though so this may be a brittle soln.)
Actual behavior
We get an indication to install the tool instead of reshim.
Environment
Copied from #914
OS:
Darwin Kalorme 20.2.0 Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64 x86_64
SHELL:
zsh 5.8 (x86_64-apple-darwin20.0)
ASDF VERSION:
v0.8.0
ASDF ENVIRONMENT VARIABLES:
ASDF_DIR=/usr/local/opt/asdf
ASDF INSTALLED PLUGINS:
golang https://github.com/kennyp/asdf-golang.git
minio https://github.com/aeons/asdf-minio.git
nodejs https://github.com/asdf-vm/asdf-nodejs.git
postgres https://github.com/smashedtoatoms/asdf-postgres.git
protoc https://github.com/paxosglobal/asdf-protoc.git
python https://github.com/danhper/asdf-python.git
redis https://github.com/smashedtoatoms/asdf-redis.git
ruby https://github.com/asdf-vm/asdf-ruby.git
yarn https://github.com/twuni/asdf-yarn.git