Skip to content
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

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

Open
samdeane opened this issue Nov 27, 2023 · 8 comments
Open

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

samdeane opened this issue Nov 27, 2023 · 8 comments
Labels

Comments

@samdeane
Copy link

samdeane commented Nov 27, 2023

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                          [email protected]:cometkim/asdf-bun.git main a79462c
bundler                      [email protected]:jonathanmorley/asdf-bundler.git master a461ac4
flutter                      [email protected]:oae/asdf-flutter.git master 5151ecb
golang                       [email protected]:asdf-community/asdf-golang.git master 33b1f6d
golangci-lint                [email protected]:hypnoglow/asdf-golangci-lint.git master a43c37c
java                         [email protected]:halcyon/asdf-java.git master f507ecf
lua                          [email protected]:Stratus3D/asdf-lua.git master 36fae6e
nodejs                       [email protected]:asdf-vm/asdf-nodejs.git master 9c4e0f2
protoc                       [email protected]:paxosglobal/asdf-protoc.git master a44c5cd
ruby                         [email protected]:asdf-vm/asdf-ruby.git master 3035a4a

asdf plugins affected (if relevant)

flutter [email protected]:oae/asdf-flutter.git master 5151ecb

@samdeane samdeane added the bug label Nov 27, 2023
@ryne-sunrun
Copy link

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
Copy link

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
Copy link

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
Copy link

Piioo commented May 2, 2024

seen same problem on mac with ruby

asdf version 0.14.0

@pesterhazy
Copy link

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

@aep-sunlife
Copy link

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.

@btoone
Copy link

btoone commented Dec 5, 2024

I came here because I have the same issue with cowsay. Not sure why a asdf is creating a shim for cowsay though.

UPDATE: Looks like I have older versions of ruby that had the cowsay gem and executable installed (instead of the Homebrew package). I manually removed the gem from each version listed in the error output and reshimed. That fixed for me.

✖ asdf list ruby
  2.2.3
  2.4.4
  2.5.3
  2.5.8
  2.6.2
  2.6.3
  2.6.5
  2.7.0
  2.7.1
  2.7.2
  3.0.2
  3.1.1
  3.2.0
 *3.3.6

✖ asdf local ruby 2.7.2

✖ gem list | rg cowsay
cowsay (0.3.0)

✖ gem uninstall cowsay

# repeat for each version listed

✖ asdf reshim

✖ asdf current ruby
ruby            3.3.6           /Users/brandon/.tool-versions

[brandon] ~
✖ ruby -v
ruby 3.3.6 (2024-11-05 revision 75015d4c1f) [x86_64-darwin22]

✖ cowsay hello
No preset version installed for command cowsay
Please install a version by running one of the following:

asdf install ruby 3.3.6

or add one of the following versions in your config file at /Users/brandon/.tool-versions
ruby 2.6.2
ruby 2.7.0
ruby 2.7.2

✖ which cowsay
/Users/brandon/.asdf/shims/cowsay

✖ /usr/local/bin/cowsay hello
 _______
< hello >
 -------
        \   ^__^
         \  (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||

@pythoninthegrass
Copy link

I was getting a similar error with python

λ activate-global-python-argcomplete
No preset version installed for command activate-global-python-argcomplete
Please install a version by running one of the following:

asdf install python 3.11.11

Initially tried uninstalling via python -m pip uninstall argcomplete, but it must have been installed in one of ~7 python runtimes.

Following @btoone's advice, went ahead and just uninstalled all the runtimes but my current one (python 3.11.11). That appeared to fix the issue.

No amount of reshimming or upgrading the asdf bin worked fwiw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

8 participants