asdf-vm / asdf

Extendable version manager with support for Ruby, Node.js, Elixir, Erlang & more
https://asdf-vm.com/
MIT License
22.12k stars 788 forks source link

bug: asdf says "no preset version installed" but it is #1686

Open samdeane opened 1 year ago

samdeane commented 1 year ago

Describe the Bug

asdf is complaining No preset version installed for command flutter

however, when I run the recommended command: asdf install flutter 3.13.6 it says: flutter 3.13.6 is already installed

And indeed it is in my .tool-versions:

> more .tool-versions                                                                                                                                                                                                                                                                                                                                                                                                     
bun 1.0.7
protoc 3.20.2
golang 1.21.4
golangci-lint 1.55.1
flutter 3.13.6
ruby 3.1.2
bundler 2.4.21

and asdf thinks it is selected:

> asdf list flutter
*3.13.6
  3.16.0-stable

Steps to Reproduce

See above description.

Expected Behaviour

Either flutter should actually need installing, or I should not get an error telling me to install it.

Actual Behaviour

See above

Environment

OS:
Darwin little-rascal.local 22.6.0 Darwin Kernel Version 22.6.0: Wed Oct  4 21:25:40 PDT 2023; root:xnu-8796.141.3.701.17~4/RELEASE_ARM64_T8103 arm64

SHELL:
fish, version 3.6.1

BASH VERSION:
3.2.57(1)-release

ASDF VERSION:
v0.13.1-0586b37

ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/sam/.asdf
ASDF_DIR=/Users/sam/.asdf
ASDF_CONFIG_FILE=/Users/sam/.asdfrc

ASDF INSTALLED PLUGINS:
bun                          git@github.com:cometkim/asdf-bun.git main a79462c
bundler                      git@github.com:jonathanmorley/asdf-bundler.git master a461ac4
flutter                      git@github.com:oae/asdf-flutter.git master 5151ecb
golang                       git@github.com:asdf-community/asdf-golang.git master 33b1f6d
golangci-lint                git@github.com:hypnoglow/asdf-golangci-lint.git master a43c37c
java                         git@github.com:halcyon/asdf-java.git master f507ecf
lua                          git@github.com:Stratus3D/asdf-lua.git master 36fae6e
nodejs                       git@github.com:asdf-vm/asdf-nodejs.git master 9c4e0f2
protoc                       git@github.com:paxosglobal/asdf-protoc.git master a44c5cd
ruby                         git@github.com:asdf-vm/asdf-ruby.git master 3035a4a

asdf plugins affected (if relevant)

flutter git@github.com:oae/asdf-flutter.git master 5151ecb

ryne-sunrun commented 10 months ago

Any resolutions? Unable to install nodejs 12 dependencies, keeps asking to install nodejs 12 but I already have, have updated asdf and have re-shimmed.

bartlebee13 commented 10 months ago

seeing the same issue with golang. I installed golang 1.21.6 with asdf. I can set it and see version 1.21.6 in my .tool-versions

I've updated asdf, reshimmed, and tried the solution outlined in this comment but its still broken.

ryne-sunrun commented 10 months ago

Update - I use IntelliJ and found in their forum that I needed to change my node interpreter, which is working. I still cannot use npm from command line

Piioo commented 6 months ago

seen same problem on mac with ruby

asdf version 0.14.0

pesterhazy commented 2 months ago

I've seen this as well with command installed via npm install -g

aep-sunlife commented 3 weeks ago

Normally, I use asdf reshim to fix problems where ASDF forgets that it needs to update shims. However, running asdf reshim for Go executables (e.g. go install ./...) appears to break things.

$ cat .tool-versions
golang 1.23.2

$ hello-world
No preset version installed for command hello-world
Please install a version by running one of the following:

asdf install golang 1.23.2

or add one of the following versions in your config file at /Users/lo40/go/src/bitbucket.us.sunlife/SecOps/hello-world-go/.tool-versions
golang 1.22.2

I don't know why asdf reshim is creating malformed shims, but I plan to refrain from using this command for awhile.