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
7.23k stars 258 forks source link

Error with installing Linter #1609

Closed Halleyscomet0855 closed 5 months ago

Halleyscomet0855 commented 5 months ago

I've searched open issues for similar requests

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

Problem description

When installing linters, mason throws an error and fails to install the linter. It appears to be some kind of error with a lua file with mason.

Expected behavior

The linter will be installed.

Affected packages

From testing: mypy, curlylint, djlint, gdtoolkit, gdtoolkit, gitlint

Mason output

..zy/mason.nvim/lua/mason-core/installer/managers/pypi.lua:66: attempt to index local '_' (a nil value)

Installation log

[ERROR 27/01/2024 8:57:49 pm] ...m-data/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=mypy) error="...zy/mason.nvim/lua/mason-core/installer/managers/pypi.lua:66: attempt to index local '_' (a nil value)"
[INFO  27/01/2024 9:01:33 pm] ...m-data/lazy/mason.nvim/lua/mason-core/installer/init.lua:184: Executing installer for Package(name=mypy) {}
[ERROR 27/01/2024 9:01:33 pm] ...m-data/lazy/mason.nvim/lua/mason-core/installer/init.lua:249: Installation failed for Package(name=mypy) error="...zy/mason.nvim/lua/mason-core/installer/managers/pypi.lua:66: attempt to index local '_' (a nil value)"

(just imagine multiple lines of this. Not sure how to turn on debug mode, sorry.

Neovim version (>= 0.7)

NVIM v0.9.5 Build type: RelWithDebInfo LuaJIT 2.1.1703942320

Operating system/version

Windows 11 Home 23H2

Healthcheck

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

mason.nvim ~
- OK mason.nvim version v1.9.0
- OK PATH: skip
- 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-01-27-faded-farm` is installed.

mason.nvim [Core utils] ~
- WARNING unzip: not available
  - ADVICE:
    - spawn: unzip failed with exit code - and signal -. unzip is not executable
- WARNING wget: not available
  - ADVICE:
    - spawn: wget failed with exit code - and signal -. wget is not executable
- OK curl: `curl 8.4.0 (Windows) libcurl/8.4.0 Schannel WinIDN
`
- WARNING gzip: not available
  - ADVICE:
    - spawn: gzip failed with exit code - and signal -. gzip is not executable
- OK tar: `bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd/1.5.4 
`
- ERROR pwsh: not available
  - ADVICE:
    - spawn: pwsh failed with exit code - and signal -. pwsh is not executable
- OK 7z: `7-Zip 23.01 (x64) : Copyright (c) 1999-2023 Igor Pavlov : 2023-06-20
`

mason.nvim [Languages] ~
- WARNING Go: not available
  - ADVICE:
    - spawn: go failed with exit code - and signal -. go is not executable
- WARNING Composer: not available
  - ADVICE:
    - spawn: composer.bat failed with exit code - and signal -. composer.bat is not executable
- WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. php is not executable
- WARNING cargo: not available
  - ADVICE:
    - spawn: cargo failed with exit code - and signal -. cargo is not executable
- WARNING luarocks: not available
  - ADVICE:
    - spawn: luarocks failed with exit code - and signal -. luarocks is not executable
- WARNING javac: not available
  - ADVICE:
    - spawn: javac failed with exit code - and signal -. javac is not executable
- WARNING java: not available
  - ADVICE:
    - spawn: java failed with exit code - and signal -. java is not executable
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
- WARNING python: not available
  - ADVICE:
    - spawn: python failed with exit code - and signal -. python is not executable
- WARNING pip: not available
  - ADVICE:
    - spawn: python failed with exit code - and signal -. python is not executable
- WARNING python venv: not available
  - ADVICE:
    - On Debian/Ubuntu systems, you need to install the python3-venv package using the following command:

      apt-get install python3-venv
- WARNING Ruby: not available
  - ADVICE:
    - spawn: ruby failed with exit code - and signal -. ruby is not executable
- WARNING RubyGem: not available
  - ADVICE:
    - spawn: gem.cmd failed with exit code - and signal -. gem.cmd is not executable
- OK node: `v20.11.0
`
- OK npm: `10.2.4`

mason.nvim [GitHub] ~
- OK GitHub API rate limit. Used: 0. Remaining: 60. Limit: 60. Reset: 27/01/2024 10:11:17 pm.
  Install and authenticate via gh-cli to increase rate limit.

Screenshots

No response

williamboman commented 5 months ago

Hey, thanks for reporting! Should be fixed in #1610. Note that the package you're trying to install relies on python3 which you don't seem to have installed, so even after updating you'll still probably run into errors (although this time a more descriptive one).

Halleyscomet0855 commented 5 months ago

Thank you very much!

For future reference to anyone who may have the same problem as me, it turned out that the version of python I installed wasn't in the environment variable. I fixed that by rerunning the python installer and checking the "include in environment variable" box.