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

No warning for required nodejs version for pyright and jedi_language_server. Ubuntu 20.04. official nodejs package breaks #357

Open
2 tasks done
schnierstein opened this issue Feb 7, 2024 · 0 comments

Comments

@schnierstein
Copy link

Problem description

After an update, I noticed the language servers jedi_language_server and pyright (just one installed at a time) stopped working with error messages pointing to ~/.local/state/nvim/lsp.log (see log message below)

Client pyright quit with exit code 1 and signal 0. Check log for errors: /home/niklas/.local/state/nvim/lsp.log

From the solution of #273 I thought about checking my installed nodejs version and where it was installed from. The Ubuntu 20.04. official package repos only deliver nodejs v10.

sudo apt-get install nodejs
nodejs --version
-> v10.19.0

Now, I think it is fine not to support older versions of nodejs anymore, BUT I think the issue is, that there is no warning in the logs that this is caused by a version issue.
It is mentioned in the :checkhealth mason to be fair, that a newer version is required, but it is not clear why and that this effects the pyright language server.

FIX:
I installed nodejs v20 from nodesource and the language server started working again without issue.

I hope it is appropriate to write this issue here, it is written with the intent to help others with similar issues. I am unfortunately not familiar enough with all the components involved to include a warning at the right location in the code.

Why do you think this is an issue with mason-lspconfig.nvim?

The error message in the log does not mention that this might be a version issue.

Neovim version (>= 0.7)

NVIM v0.10.0-dev-1506+g610f50dda
Build type: RelWithDebInfo
LuaJIT 2.1.1699392533

Operating system/version

Linux niklas-think 5.15.0-92-generic #102~20.04.1-Ubuntu SMP Mon Jan 15 13:09:14 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

I've manually reviewed the Nvim LPS client log (:LspLog) to find potential errors

  • Yes

I've recently downloaded the latest plugin version of mason.nvim, mason-lspconfig.nvim, and nvim-lspconfig

  • Yes

Affected language servers

pyright, jedi_language_server

Steps to reproduce

Fresh Ubuntu 20.04.
Install nvim, mason, mason-lsp etc as described in the repos.
Install nodejs from official ubuntu repos
Should cause the described error.

Not tested:
Downgrade nodejs version installed and start nvim with mason and pyright or jedi_language_server installed.

Actual behavior

Pyright / jedi language server crash when opening .py files
Log does not directly indicate version issue

Expected behavior

Throw a warning if specific language server needs certain software requirements

LspInfo

Language client log: /home/niklas/.local/state/nvim/lsp.log
Detected filetype:

0 client(s) attached to this buffer:

Configured servers list: pyright, julials, texlab, bashls, lua_ls, clangd, fortls

LspLog

[START][2024-02-07 14:44:57] LSP logging initiated
[ERROR][2024-02-07 14:44:57] .../vim/lsp/rpc.lua:675    "rpc"   "/home/niklas/.local/share/nvim/mason/bin/pyright-langserver"   "stderr"        '/home/niklas/.local/share/nvim/mason/packages/pyright/node_modules/pyright/dist/vendor.js:2\nexports.id=736,exports.ids=[736],exports.modules={2034:(A,e,t)=>{"use strict";const r=t(7627),o=global.Date;class i extends o{constructor(A){super(A),this.isDate=!0}toISOString(){return`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}`}}A.exports=A=>{const e=new i(A);if(isNaN(e))throw new TypeError("Invalid Datetime");return e}},1374:(A,e,t)=>{"use strict";const r=t(7627);class o extends Date{constructor(A){super(A+"Z"),this.isFloating=!0}toISOString(){return`${this.getUTCFullYear()}-${r(2,this.getUTCMonth()+1)}-${r(2,this.getUTCDate())}T${r(2,this.getUTCHours())}:${r(2,this.getUTCMinutes())}:${r(2,this.getUTCSeconds())}.${r(3,this.getUTCMilliseconds())}`}}A.exports=A=>{const e=new o(A);if(isNaN(e))throw new TypeError("Invalid Datetime");return e}},264:A=>{"use strict";A.exports=A=>{const e=new Date(A);if(isNaN(e))throw new TypeError("Invalid Datetime");return e}},6872:(A,e,t)=>{"use st\n\nSyntaxError: Unexpected token ;\n    at Module._compile (internal/modules/cjs/loader.js:723:23)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)\n    at Module.load (internal/modules/cjs/loader.js:653:32)\n    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)\n    at Function.Module._load (internal/modules/cjs/loader.js:585:3)\n    at Module.require (internal/modules/cjs/loader.js:692:17)\n    at require (internal/modules/cjs/helpers.js:25:18)\n    at Object.s.f.require (/home/niklas/.local/share/nvim/mason/packages/pyright/node_modules/pyright/dist/pyright-langserver.js:1:1895)\n    at Promise.all.Object.keys.reduce (/home/niklas/.local/share/nvim/mason/packages/pyright/node_modules/pyright/dist/pyright-langserver.js:1:1363)\n    at Array.reduce (<anonymous>)\n'

Healthcheck

mason: require("mason.health").check()

mason.nvim ~
- OK mason.nvim version v1.10.0
- OK PATH: prepend
- OK Providers:
    mason.providers.registry-api
    mason.providers.client
- OK neovim version >= 0.7.0

mason.nvim [Registries] ~
- OK Registry `github.com/mason-org/mason-registry version: 2024-02-07-frayed-food` is installed.

mason.nvim [Core utils] ~
- OK unzip: `UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP.`
- OK wget: `GNU Wget 1.20.3 built on linux-gnu.`
- OK curl: `curl 7.68.0 (x86_64-pc-linux-gnu) libcurl/7.68.0 OpenSSL/1.1.1f zlib/1.2.11 brotli/1.0.7 libidn2/2.2.0 libpsl/0.21.0 (+libidn2/2.2.0) libssh/0.9.3/openssl/zlib nghttp2/1.40.0 librtmp/2.3`
- OK gzip: `gzip 1.10`
- OK tar: `tar (GNU tar) 1.30`
- OK bash: `GNU bash, version 5.0.17(1)-release (x86_64-pc-linux-gnu)`
- OK sh: `Ok`

mason.nvim [Languages] ~
- WARNING luarocks: not available
  - ADVICE:
    - spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. composer is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- WARNING npm: not available
  - ADVICE:
    - spawn: npm failed with exit code - and signal -. npm is not executable
- WARNING Go: unsupported version `go version go1.13.8 linux/amd64`
  - ADVICE:
    - Go version must be >= 1.17.
- WARNING node: unsupported version `v10.19.0`
  - ADVICE:
    - Node version must be >= 14
- OK Ruby: `ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-linux-gnu]`
- OK cargo: `cargo 1.74.0 (ecb9851af 2023-10-18)`
- OK python: `Python 3.8.10`
- OK julia: `julia version 1.4.1`
- OK java: `openjdk version "11.0.21" 2023-10-17`
- OK RubyGem: `3.1.2`
- OK javac: `javac 11.0.21`
- OK pip: `pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)`
- OK python venv: `Ok`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Mi 07 Feb 2024 16:06:42 CET.
  Install and authenticate via gh-cli to increase rate limit.

Screenshots or recordings

No response

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

1 participant