-
Notifications
You must be signed in to change notification settings - Fork 788
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
Shim not using global NodeJS version #822
Comments
I have the same problem too!!! With asdf current I have nodejs 14.15.0 ... I intsalled it globally and also I use it locally for my project (.tool-versions has nodejs 14.15.0). But if I do node -v from my terminal it shows me v.12.15.0 |
I've upgraded node plugin of asdf, but it didn't resolve the problem |
I've solved the problem by adding
And I use this plugin, because I use oh-my-zsh. So, I think that the bug is inside oh-my-zsh plugin. @delucca , just add what I mentioned and reopen your terminal. This BTW works in Linux |
my .zshrc:
|
without |
I don't know if this is related, but I was having a similar problem with trying to run
I eventually (after longer than I'm willing to admit 😄) realized that because I had just installed nodejs 13.8.0, |
I believe @CraigCottingham has found the cause of the issue, I will use the details he provided for a scenario. I may be off with some of this, but it's the gist as I understand it today. asdf plugins add shims to the
This error is somewhat unhelpful. It should probably read something like:
To resolve this issue, I think we need to update the error messaging for this scenario. @delucca does this description help you resolve your issue? |
@jthegedus I think it does. I'm no longer facing this issue since I've moved from Emacs to Atom, but I think that the error message would make it easier to understand. But, there is a more complex issue here. I was using a plugin called |
@delucca Sorry, I used the details from @CraigCottingham in this thread.
Had
Simplifying my earlier explanation: asdf > plugins > install tools > shim stored in a global lookup (version independent) @ when a command is executed:
There is a situation whereby a shim is created for the same tool from different plugins (see #828). Let's take
on my machine with both
It is up to the user to manage whether a shim is managed by two different plugins. We provide the tools to investigate this with We need to improve our error outputs however to make the situation that started this thread more clear. |
I went looking for the specific code that gave the error: Line 778 in bd21c99
Unfortunately my bash skills are severely lacking so I can't really update the error message and/or the code that tests it. |
Maybe it's good to make a separate issue for that, because this issue started out with something different and the fix for the original issue is (imho) improving the error message per the suggestion of @jthegedus |
@jthegedus Improving the error messaging to something similar to what you suggested would be extremely helpful. It is confusing to get a message telling you to install the missing version when you know you have a plugin installed and a version specified in the .tool-versions file. There are some counter intuitive things with asdf that should be taken care of. For example when installing postgres with asdf it doesn't add the same flags that homebrew does, such as installing with OpenSSL and other libs. So you end up having to go through documentation to figure out how to add these flags. When installing postgres with homebrew that was taken care of so it ought to be the same seamless process here. |
This addition is necessary to add the `tsserver` command (external to the one managed by lsp-mode in emacs) with each version of node installed. Without this change, I was seeing [this error](asdf-vm/asdf#822 (comment)). The root cause is outlined in the next comment.
As for me, the problem was with PATH. I had such
I don't remember why I added that 😅 . |
Closing this issue because I think #928 is the only remaining bug here for asdf-core. |
Hi!
I'm trying to initialize my
lsp-mode
(at Emacs) using thets-ls
tsserver
to do so. But, when I start the server the following error happens:It is strange, because I have NodeJS version
12.18.1
installed, as you can se:And also, the project is not using NodeJS 12.18.1, it is using 15.0.0:
If I change the
.tool-versions
file to use Node 12.18.1 it works, but I should not do so, since my project required 15.0.0Any idea how to fix it?
The text was updated successfully, but these errors were encountered: