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

Some languages have incorrect startup paths #1315

Open
3 tasks done
dxy2233 opened this issue May 22, 2023 · 7 comments
Open
3 tasks done

Some languages have incorrect startup paths #1315

dxy2233 opened this issue May 22, 2023 · 7 comments

Comments

@dxy2233
Copy link

dxy2233 commented May 22, 2023

I've searched open issues for similar requests

  • Yes

I've manually reviewed logs to find potential errors

  • Yes

I've recently downloaded the latest plugin version of mason.nvim

  • Yes

Problem description

屏幕截图 2023-05-22 103005

As shown in the image.
The annotation content is the generated invocation path when downloading that language.
The non-commented part is the modified path that can be correctly invoked.

The operating environment is within WSL 2 with Arch Linux, and I'm unsure if it's influenced by other configurations.

Expected behavior

Configure the correct path.

Steps to reproduce

After the default installation, it is not possible to use it. Opening the log information indicates that the path content is not found.

Affected packages

all

Neovim version (>= 0.7)

0.9

Operating system/version

wsl2, arch

Healthcheck

No problem

Screenshots or recordings

No response

@williamboman
Copy link
Owner

I'm having some difficulties understanding what the issue is.

Is it correct that in the image you've provided, the visible buffer displays the contents of ~/.local/share/nvim/mason/bin/vue-language-server?

Can you also provide :checkhealth contents? What version of npm do you have installed?

@dxy2233
Copy link
Author

dxy2233 commented May 23, 2023

Some languages have incorrect invocation paths after installation, such as vue-language-server and emmet-ls.

checkhealth may be no problem.

屏幕截图 2023-05-23 150359
屏幕截图 2023-05-23 150452

@williamboman
Copy link
Owner

I don't recognize the script contents of the executable (this is provided entirely by npm). Due to how it's implemented (it relies on relative paths from the executable itself) it's not compatible with the symlinking of executables that Mason does. I will need to investigate exactly what happens on WSL.

@Trildar
Copy link

Trildar commented Sep 12, 2023

The script is a shim script that npm normally outputs on Windows. The logic to output shims vs creating symlinks can be seen here: https://github.com/npm/cli/blob/latest/node_modules/bin-links/lib/link-bins.js

I think what happened is that the Windows-installed npm was called when Mason installed the packages for these language servers, which causes the shims to be output instead of symlinks. I encountered this myself, and after installing Node in WSL, thus making npm invoke an instance installed in WSL, the npm packages installed by Mason then had symlinks in .bin and everything works correctly.

@powN1
Copy link

powN1 commented Dec 20, 2023

Ran into the same issue on WSL2 (Ubuntu 22.04). The path was wrong and had to manually change it (tsserver and pyright) just like OP did. I also run the same configuration on windows 10 and it works without any problems.

@Trildar
Copy link

Trildar commented Dec 20, 2023

@powN1 Did you have npm installed on Windows? Did you also have it installed in WSL? If you had it installed in both, does which npm give you the one installed in WSL?

@tchaudhry91
Copy link

I can confirm that this was the cause for me as well.
WSL was preferring the npm installed via scoop in windows over the one I had locally installed in WSL. Once I fixed that and which npm started reporting the local one. Everything works as expected.
Thanks @Trildar for the tip.

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

No branches or pull requests

5 participants