-
Notifications
You must be signed in to change notification settings - Fork 783
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Identify different class of error between *missing version* from *requiring a reshim* #928
Comments
Hey @jthegedus, thanks for opening this, I was just about to! To contextualise this issue:I think that from the perspective of a new user, encountering this error is a big stumbling block. A very common new Maybe it is someone who wants to start working on a Node.js project with $ asdf install nodejs latest:14
$ npm i -g yarn
# Yay! Now let me start building!
$ yarn init
# Oh no! What happened?
No preset version installed for command yarn
Please install a version by running one of the following:
asdf install nodejs 14.16.1
or add one of the following versions in your config file at /home/me/workspace/project/.tool-versions
nodejs 15.14.0
# How do I fix this? Let me try the instructions...
# Oh no, that didn't work.
# What do I do now? Or, they might want to start working on a Ruby on Rails project (also a typical use). They'd follow a similar flow: install the language, install a binary through the language's package manager (in this case, I would imagine that these examples show that this flow is disproportionately common. The problem is that the error message is simply wrong in this typical user flow. The instructions it gives will not fix the problem. However, the fix is actually very simple: just running Proposed solutionTo me, because
I think we should change the error message to instruct the user to try running I'm sure this will reduce the contributors' burden of responding to new issues that should have been solved just by reshimming. I'd love to hear your thoughts because I think this is an opportunity for a substantially better first user experience. I'm happy to submit a PR if you agree. |
#822 May also be solved by this. |
@xtyrrell I would like the soln to only show one error and for the correct case. Adding "also try You're welcome to have a go at solving this, it would greatly help! |
Hi, thank you for your work on The problem is that it's possible to set the version of a plugin to
Because it is possible to both |
This is a super confusing problem.
I have my global go version set to 1.18, and installed:
once I changed to a sub directory (that has a .tool-versions file with golang 1.16.6 set, I try to run that globally installed binary, I get that error. Here’s where the binary lives.
Is this problem also because |
In case it helps, I've been experiencing an edge-case with this:
Neither |
Found this Github issue when encountering the same exact problem. In my case, the node versions are different (14.15.4 and 14.17.0), but the same problem where the shim-versions for node have all the installed versions, while the shim-versions for yarn only have the one. |
FWIW, I resolved this by re-running |
This has also worked for me. |
This is expected behaviour because each version of a tool (plus its binaries) is installed seperately. If you install |
Oh, this. This, very much this. I'm thankful for I strongly propose to have a doc section, FAQ entry or some such, dedicated to this error and adding a link in the error message, since this error comes in multiple situations, some disambiguation is needed. I humbly add my voice to this request here (from #1631). |
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 andasdf
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:
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
The text was updated successfully, but these errors were encountered: