williamboman / mason.nvim

Portable package manager for Neovim that runs everywhere Neovim runs. Easily install and manage LSP servers, DAP servers, linters, and formatters.
Apache License 2.0
8.01k stars 281 forks source link

Glint language server from `@glint/core` erroring upon installation. #946

Closed NullVoxPopuli closed 1 year ago

NullVoxPopuli commented 1 year ago

I've searched open issues for similar requests

Yes

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

Problem description

<mason log> was originally here, but I saw that there was a required field explicitly asking for the log

I have glint set up as an "ensure installed" thing, which results in this upon opening neovim:

image

The config is this:

require("mason-lspconfig").setup {
  ensure_installed = servers,
  automatic_installation = false
}

the automatic_installation thing is a bit :shrug:

I know I was involved in adding glint to the mason stuff, but I've totally forgotten everything, how to check stuff, etc. The language server comes from @glint/core, which we probably don't want to install by default, and instead want to default to the @glint/core present in the nearest package.json for a project (and not above that).

Expected behavior

no error

Affected packages

mason, mason-config

Mason output

`:Mason` ``` mason.nvim press g? for help https://github.com/williamboman/mason.nvim (1) All (2) LSP (3) DAP (4) Linter (5) Formatter Language Filter: press to apply filter Installed ◍ actionlint ◍ bash-language-server ◍ chrome-debug-adapter ◍ css-lsp ◍ dockerfile-language-server ◍ ember-language-server ◍ eslint-lsp ◍ eslint_d ◍ graphql-language-service-cli ◍ html-lsp ◍ json-lsp ◍ lua-language-server ◍ node-debug2-adapter ◍ shellcheck ◍ tailwindcss-language-server ◍ typescript-language-server ◍ yaml-language-server Available ◍ ada-language-server ◍ alex ◍ angular-language-server ◍ ansible-language-server ◍ apex-language-server ◍ arduino-language-server ◍ asm-lsp ◍ astro-language-server ◍ autoflake ◍ autopep8 ◍ awk-language-server ◍ bash-debug-adapter ◍ beancount-language-server ◍ beautysh ◍ bicep-lsp ◍ black ◍ blackd-client ◍ blade-formatter ◍ blue ◍ brighterscript ◍ bsl-language-server ◍ buf ◍ buf-language-server ◍ buildifier ◍ cbfmt ◍ cfn-lint ◍ clang-format ◍ clangd ◍ clarity-lsp ◍ clojure-lsp ◍ cmake-language-server ◍ cmakelang ◍ codelldb ◍ codeql ◍ codespell ◍ colorgen-nvim ◍ commitlint ◍ cpplint ◍ cpptools ◍ crystalline ◍ csharp-language-server ◍ csharpier ◍ cspell ◍ cssmodules-language-server ◍ cucumber-language-server ◍ cueimports ◍ cuelsp ◍ curlylint ◍ dart-debug-adapter ◍ debugpy ◍ delve ◍ deno ◍ dhall-lsp ◍ diagnostic-languageserver ◍ djlint ◍ dot-language-server ◍ dprint ◍ drools-lsp ◍ editorconfig-checker ◍ efm ◍ elixir-ls ◍ elm-format ◍ elm-language-server ◍ emmet-ls ◍ erb-lint ◍ erg ◍ erg-language-server ◍ erlang-ls ◍ esbonio ◍ fantomas ◍ firefox-debug-adapter ◍ fixjson ◍ flake8 ◍ flux-lsp ◍ foam-language-server ◍ fortls ◍ fourmolu ◍ fsautocomplete ◍ gersemi ◍ gitlint ◍ gitui ◍ glint ◍ glow ◍ go-debug-adapter ◍ gofumpt ◍ goimports ◍ goimports-reviser ◍ golangci-lint ◍ golangci-lint-langserver ◍ golines ◍ gomodifytags ◍ gopls ◍ gotests ◍ gotestsum ◍ gradle-language-server ◍ grammarly-languageserver ◍ groovy-language-server ◍ hadolint ◍ haml-lint ◍ haskell-language-server ◍ haxe-language-server ◍ hoon-language-server ◍ iferr ◍ impl ◍ intelephense ◍ isort ◍ java-debug-adapter ◍ java-test ◍ jdtls ◍ jedi-language-server ◍ joker ◍ jq ◍ jq-lsp ◍ js-debug-adapter ◍ json-to-struct ◍ jsonlint ◍ jsonnet-language-server ◍ julia-lsp ◍ kotlin-debug-adapter ◍ kotlin-language-server ◍ ktlint ◍ lelwel ◍ lemminx ◍ lemmy-help ◍ ltex-ls ◍ luacheck ◍ luaformatter ◍ luau-lsp ◍ markdownlint ◍ marksman ◍ metamath-zero-lsp ◍ misspell ◍ mockdebug ◍ move-analyzer ◍ mypy ◍ neocmakelsp ◍ netcoredbg ◍ nginx-language-server ◍ nickel-lang-lsp ◍ nil ◍ nimlsp ◍ nxls ◍ ocaml-lsp ◍ ocamlformat ◍ omnisharp ◍ omnisharp-mono ◍ opencl-language-server ◍ openscad-lsp ◍ perlnavigator ◍ php-cs-fixer ◍ php-debug-adapter ◍ phpactor ◍ phpcbf ◍ phpcs ◍ phpmd ◍ phpstan ◍ pint ◍ powershell-editor-services ◍ prettier ◍ prettierd ◍ prisma-language-server ◍ proselint ◍ prosemd-lsp ◍ protolint ◍ psalm ◍ puppet-editor-services ◍ purescript-language-server ◍ pydocstyle ◍ pylama ◍ pylint ◍ pyproject-flake8 ◍ pyre ◍ pyright ◍ python-lsp-server ◍ quick-lint-js ◍ r-languageserver ◍ raku-navigator ◍ reason-language-server ◍ remark-cli ◍ remark-language-server ◍ reorder-python-imports ◍ rescript-lsp ◍ revive ◍ rnix-lsp ◍ robotframework-lsp ◍ rome ◍ rstcheck ◍ rubocop ◍ ruby-lsp ◍ ruff ◍ ruff-lsp ◍ rust-analyzer ◍ rustfmt ◍ rustywind ◍ salt-lsp ◍ selene ◍ semgrep ◍ serve-d ◍ shellharden ◍ shfmt ◍ shopify-theme-check ◍ slint-lsp ◍ smithy-language-server ◍ solang ◍ solargraph ◍ solhint ◍ solidity ◍ solidity-ls ◍ sorbet ◍ sourcery ◍ spectral-language-server ◍ sql-formatter ◍ sqlfluff ◍ sqlls ◍ sqls ◍ standardrb ◍ staticcheck ◍ stylelint-lsp ◍ stylua ◍ svelte-language-server ◍ svlangserver ◍ svls ◍ taplo ◍ teal-language-server ◍ tectonic ◍ terraform-ls ◍ texlab ◍ textlint ◍ tflint ◍ twigcs ◍ unocss-language-server ◍ usort ◍ vala-language-server ◍ vale ◍ verible ◍ vetur-vls ◍ vim-language-server ◍ vint ◍ visualforce-language-server ◍ vls ◍ vtsls ◍ vue-language-server ◍ vulture ◍ wgsl-analyzer ◍ write-good ◍ xmlformatter ◍ xo ◍ yamlfmt ◍ yamllint ◍ yapf ◍ zk ◍ zls ```

Installation log

`:MasonLog` shows this ``` [INFO Sun 23 Oct 2022 11:48:42 AM EDT] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:118: Executing installer for Package(name=glint-language-server) [INFO Sun 23 Oct 2022 11:49:29 AM EDT] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:118: Executing installer for Package(name=glint-language-server) [INFO Sun 23 Oct 2022 11:49:40 AM EDT] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:118: Executing installer for Package(name=glint-language-server) [INFO Sun 23 Oct 2022 11:49:45 AM EDT] ...acker/start/mason.nvim/lua/mason-core/installer/init.lua:150: Installation succeeded for Package(name=glint-language-server) [ERROR Sun 23 Oct 2022 12:44:03 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:44:03 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:44:38 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:44:38 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:44:42 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:44:42 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:44:53 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:44:53 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: bad argument #1 to '?' (string expected, got nil) [ERROR Sun 23 Oct 2022 12:46:46 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: module 'mason-registry.glint-language-server' not found: no field package.preload['mason-registry.glint-language-server'] no file './mason-registry/glint-language-server.lua' no file '/__w/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/mason-registry/glint-language-server.lua' no file '/usr/local/share/lua/5.1/mason-registry/glint-language-server.lua' no file '/usr/local/share/lua/5.1/mason-registry/glint-language-server/init.lua' no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/mason-registry/glint-language-server.lua' no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/mason-registry/glint-language-server/init.lua' no file './mason-registry/glint-language-server.so' no file '/usr/local/lib/lua/5.1/mason-registry/glint-language-server.so' no file '/__w/neovim/neovim/.deps/usr/lib/lua/5.1/mason-registry/glint-language-server.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './mason-registry.so' no file '/usr/local/lib/lua/5.1/mason-registry.so' no file '/__w/neovim/neovim/.deps/usr/lib/lua/5.1/mason-registry.so' no file '/usr/local/lib/lua/5.1/loadall.so' [ERROR Sun 23 Oct 2022 12:46:46 PM EDT] ...pack/packer/start/mason.nvim/lua/mason-registry/init.lua:67: module 'mason-registry.glint-language-server' not found: no field package.preload['mason-registry.glint-language-server'] no file './mason-registry/glint-language-server.lua' no file '/__w/neovim/neovim/.deps/usr/share/luajit-2.1.0-beta3/mason-registry/glint-language-server.lua' no file '/usr/local/share/lua/5.1/mason-registry/glint-language-server.lua' no file '/usr/local/share/lua/5.1/mason-registry/glint-language-server/init.lua' no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/mason-registry/glint-language-server.lua' no file '/__w/neovim/neovim/.deps/usr/share/lua/5.1/mason-registry/glint-language-server/init.lua' no file './mason-registry/glint-language-server.so' no file '/usr/local/lib/lua/5.1/mason-registry/glint-language-server.so' no file '/__w/neovim/neovim/.deps/usr/lib/lua/5.1/mason-registry/glint-language-server.so' no file '/usr/local/lib/lua/5.1/loadall.so' no file './mason-registry.so' no file '/usr/local/lib/lua/5.1/mason-registry.so' no file '/__w/neovim/neovim/.deps/usr/lib/lua/5.1/mason-registry.so' no file '/usr/local/lib/lua/5.1/loadall.so'} ```

Neovim version (>= 0.7)

❯ nvim --version
NVIM v0.9.0-dev-771+g18fb669b9
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/gcc-10  -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g  -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_UNIBI_HAS_VAR_FROM -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -I/__w/neovim/neovim/.deps/usr/include/luajit-2.1 -I/usr/include -I/__w/neovim/neovim/.deps/usr/include -I/__w/neovim/neovim/build/src/nvim/auto -I/__w/neovim/neovim/build/include -I/__w/neovim/neovim/build/cmake.config -I/__w/neovim/neovim/src
Compiled by root@18b77a365fc3

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/__w/neovim/neovim/build/nvim.AppDir/usr/share/nvim"

Run :checkhealth for more info

Operating system/version

Linux hephaestus 5.15.0-58-generic #64-Ubuntu SMP Thu Jan 5 11:43:13 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Healthcheck

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

mason.nvim report ~
- OK neovim version >= 0.7.0
- WARNING **Go**: not available
- WARNING **cargo**: not available
- WARNING **luarocks**: not available
- OK **Ruby**: `ruby 2.7.4p191 (2021-07-07 revision a21a3b7d23) [x86_64-linux]`
- OK **RubyGem**: `3.1.6`
- WARNING **Composer**: not available
- WARNING **PHP**: not available
- OK **npm**: `9.3.0`
- OK **node**: `v16.15.1`
- OK **python3**: `Python 3.10.6`
- OK **pip3**: `pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)`
- OK **javac**: `javac 18.0.2-ea`
- OK **java**: `openjdk version "18.0.2-ea" 2022-07-19`
- WARNING **julia**: not available
- OK **wget**: `GNU Wget 1.21.2 built on linux-gnu.`
- OK **curl**: `curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/3.0.2 zlib/1.2.11 brotli/1.0.9 zstd/1.4.8 libidn2/2.3.2 libpsl/0.21.0 (+libidn2/2.3.2) libssh/0.9.6/openssl/zlib nghttp2/1.43.0 librtmp/2.3 OpenLDAP/2.5.13`
- OK **gzip**: `gzip 1.10`
- OK **tar**: `tar (GNU tar) 1.34`
- WARNING **pwsh**: not available
- OK **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
- OK **sh**: `Ok`
- OK GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: Wed 25 Jan 2023 09:55:22 PM EST.

Screenshots

No response

williamboman commented 1 year ago

Hello! So glint-language-server is not a valid package name, it's glint. The Mason log seem to suggest that glint was successfully installed, is it not? The :Mason output you provided does not provide any relevant information - if the installation still fails the reason why it fails should be visible in this window.

NullVoxPopuli commented 1 year ago

Is this what you're looking for?

                                                  mason.nvim 
                                              press g? for help
                                  https://github.com/williamboman/mason.nvim
   (1) All   (2) LSP   (3) DAP   (4) Linter   (5) Formatter  

  Language Filter: press <C-f> to apply filter

  Failed
    ◍ glint
      ▼ Displaying full log
        npm WARN config global-style This option has been deprecated in favor of `--install-strategy=shallow`
        Wrote to /home/nullvoxpopuli/.local/share/nvim/mason/.packages/glint/package.json:

        {
          "name": "@mason/glint",
          "version": "1.0.0",
          "description": "",
          "main": "index.js",
          "scripts": {
            "test": "echo \"Error: no test specified\" && exit 1"
          },
          "keywords": [],
          "author": "",
          "license": "ISC"
        }

        Initialized npm root
        npm WARN config global-style This option has been deprecated in favor of `--install-strategy=shallow`

        added 48 packages, and audited 49 packages in 859ms

        6 packages are looking for funding
          run `npm fund` for details

        found 0 vulnerabilities
        ...ker/start/mason.nvim/lua/mason-core/installer/linker.lua:43: bin/glint-language-server is already linked.

?

I could not find where glint-language-server was coming from / configured :thinking:

williamboman commented 1 year ago

So in the PR you created the package was called glint-language-server, this was later renamed to just glint. You had probably already installed the old glint-language-server locally before the rename, so you'll need to clean up these artifacts manually. It should be enough to simply unlink the bin/glint-language-server file and then remove the packages/glint-language-server directory if it exists. These files & directories exist within Mason's install dir, which defaults to ~/.local/share/nvim/mason.

NullVoxPopuli commented 1 year ago

Perfect, so I just had to delete that folder and re-install everything. woohoo!

thanks

Proof of success: image