No idea.
which is a system level binary and shouldn't be taken over by asdf.
Running which by itself prints asdf: No version set for command which. What in the world?!?
OS: macOS Mojave
asdf version: 0.7.4
Can you check what hijacked which with \type which?
My solution was to completely uninstall all versions of node _and_ uninstall the plugin from asdf and then reinstall. No idea what did it. I promise I didn't do anything weird or out of the ordinary. Just basic standard npm stuffs. 馃し鈥嶁檪
I'm experiencing this issue as well:
$ which
usage: which [-as] program ...
$ source ~/.asdf/asdf.fish
$ which
asdf: No version set for command which
you might want to add one of the following in your .tool-versions file:
nodejs 8.12.0
$ asdf plugin list
nodejs
ruby
$ /usr/bin/which which
/Users/dean/.asdf/shims/which
~/.asdf/shims ((v0.7.6))$ cat which
#!/usr/bin/env bash
# asdf-plugin: nodejs 8.12.0
exec /Users/dean/.asdf/bin/asdf exec "which" "$@"
removing this file resolved it - I didn't track it down, but I'm guessing it's a node executable that conflicts.
Yeah, there is a npm package that seems to get installed that specifies its own version of which. Sorry to not have a solution to this, but the only option right now is to just not use that package.
Happening for me too, I already "unshimmed" which quite some times already, but asdf reshim which is required to "fix" certain situations always re-adds it.
Decided to look more into it, I'm pretty sure this is a "works for me" scenario, but when checking ~/.asdf/shims/which I saw the following:

asdf gives you the knowledge of which (no pun intended) node versions use this invalid "which".
In my case, nodejs 12.2.0 was the culprit, I removed it by issueing asdf uninstall nodejs 12.2.0 and then ran asdf reshim, afterwards I could use which normally once again.
To check out if it would re-appear when reinstalling 12.2.0 what I did was asdf install nodejs 12.2.0 followed by an asdf reshim. This time, I was able to keep using which normally as well.
So no need to remove all node versions and the asdf node plugin, just reinstall the offending node versions mentioned in ~/.asdf/shims/which and asdf reshim afterwards.
Weird stuff, easily fixed permanently though (fortunately). Hope this helps!
I couldn't get it working, but if you want desperately want to use which without needing to do anything, you can use /usr/bin/which something
Most helpful comment
Happening for me too, I already "unshimmed"
whichquite some times already, butasdf reshimwhich is required to "fix" certain situations always re-adds it.Decided to look more into it, I'm pretty sure this is a "works for me" scenario, but when checking
~/.asdf/shims/whichI saw the following:asdfgives you the knowledge of which (no pun intended) node versions use this invalid "which".In my case,
nodejs 12.2.0was the culprit, I removed it by issueingasdf uninstall nodejs 12.2.0and then ranasdf reshim, afterwards I could usewhichnormally once again.To check out if it would re-appear when reinstalling 12.2.0 what I did was
asdf install nodejs 12.2.0followed by anasdf reshim. This time, I was able to keep usingwhichnormally as well.So no need to remove all node versions and the asdf node plugin, just reinstall the offending node versions mentioned in
~/.asdf/shims/whichandasdf reshimafterwards.Weird stuff, easily fixed permanently though (fortunately). Hope this helps!