Search code examples
node.jsnpmneovimmason

How to solve mason.nvim [Core Utils] warnings


I`m trying to install pyright with mason, but the error

Failed
     󰚌 pyright
      ▼ Displaying full log
        spawn: npm.cmd failed with exit code - and signal -. npm.cmd is not executable

I investigated a little, and discovered that node.js was required, so I installed it. The error still persists using :Mason and :checkhealth I see the following warnigns.

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.0.1 (Windows) libcurl/8.0.1 Schannel WinIDN
`
- WARNING gzip: not available
  - ADVICE:
    - spawn: gzip failed with exit code - and signal -. gzip is not executable
- OK tar: `bsdtar 3.5.2 - libarchive 3.5.2 zlib/1.2.5.f-ipp bz2lib/1.0.6 
`
- ERROR pwsh: not available
  - ADVICE:
    - spawn: pwsh failed with exit code - and signal -. pwsh is not executable
- WARNING 7z: not available
  - ADVICE:
    - spawn: 7z failed with exit code - and signal -. 7z is not executable

mason.nvim [Languages] ~
- WARNING Go: not available
  - ADVICE:
    - spawn: go failed with exit code - and signal -. go 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 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
- 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 npm: not available
  - ADVICE:
    - spawn: npm.cmd failed with exit code - and signal -. npm.cmd is not executable
- WARNING node: not available
  - ADVICE:
    - spawn: node failed with exit code - and signal -. node is not executable
- WARNING javac: not available
  - ADVICE:
    - spawn: javac failed with exit code - and signal -. javac is not executable
- WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. julia is not executable
...
WhichKey: checking conflicting keymaps ~
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gc"**
- rhs: ` `
- WARNING conflicting keymap exists for mode **"n"**, lhs: **"gb"**
- rhs: ` 

the pwsh ERROR puzzles me, as I am currently running nvim on powershell, and from what I could find, pwsh means powershell.


Solution

  • My bet is that node/npm is not in the PATH or maybe you need to restart neovim and/or powershell.

    Regarding powershell and pwsh, you might be running neovim in legacy powershell instead of the new, portable pwsh (see What is the difference between [pwsh] and [Powershell Integrated Console] on VS Code?)