1

I was trying to use a Python Lsp in my project to code faster with Neovim. However, I can't install the Pyright Lsp with Mason because there's an error with npm.

    ◍ pyright
      ▶ # [46/46] npm error You can rerun the command with `--loglevel=verbose` to see the logs in your terminal

Specs:

  • python==3.13.3
  • npm==11.4.1
  • node==23.11.1
  • OS==Archlinux
  • Kernel==6.14.7-arch2-1
  • neovim==0.11.1

Mason checkhealth


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

mason.nvim ~
- ✅ OK mason.nvim version v2.0.0
- ✅ OK PATH: prepend
- ✅ OK Providers: 
    mason.providers.registry-api
    mason.providers.client
- ✅ OK neovim version >= 0.10.0

mason.nvim [Registries] ~
- ✅ OK Registry `github.com/mason-org/mason-registry version: 2025-05-31-curly-trust` is installed.

mason.nvim [Core utils] ~
- ✅ OK unzip: `UnZip 6.00 of 20 April 2009, by Info-ZIP.  Maintained by C. Spieler.  Send`
- ✅ OK wget: `GNU Wget 1.25.0, a non-interactive network retriever.`
- ✅ OK curl: `curl 8.14.0 (x86_64-pc-linux-gnu) libcurl/8.14.0 OpenSSL/3.5.0 zlib/1.3.1 brotli/1.1.0 zstd/1.5.7 libidn2/2.3.7 libpsl/0.21.5 libssh2/1.11.1 nghttp2/1.65.0 nghttp3/1.10.1`
- ✅ OK gzip: `gzip 1.14-modified`
- ✅ OK tar: `tar (GNU tar) 1.35`
- ✅ OK bash: `GNU bash, version 5.2.37(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 -. Could not find executable "luarocks" in PATH.

- ⚠️ WARNING Ruby: not available
  - ADVICE:
    - spawn: ruby failed with exit code - and signal -. Could not find executable "ruby" in PATH.

- ⚠️ WARNING RubyGem: not available
  - ADVICE:
    - spawn: gem failed with exit code - and signal -. Could not find executable "gem" in PATH.

- ⚠️ WARNING Composer: not available
  - ADVICE:
    - spawn: composer failed with exit code - and signal -. Could not find executable "composer" in PATH.

- ⚠️ WARNING PHP: not available
  - ADVICE:
    - spawn: php failed with exit code - and signal -. Could not find executable "php" in PATH.

- ⚠️ WARNING javac: not available
  - ADVICE:
    - spawn: javac failed with exit code - and signal -. Could not find executable "javac" in PATH.

- ⚠️ WARNING java: not available
  - ADVICE:
    - spawn: java failed with exit code - and signal -. Could not find executable "java" in PATH.

- ⚠️ WARNING julia: not available
  - ADVICE:
    - spawn: julia failed with exit code - and signal -. Could not find executable "julia" in PATH.

- ✅ OK node: `v23.11.1`
- ✅ OK cargo: `cargo 1.86.0 (adf9b6ad1 2025-02-28)`
- ✅ OK Go: `go version go1.24.3 linux/amd64`
- ✅ OK python: `Python 3.13.3`
- ⚠️ WARNING pip: not available
  - ADVICE:
    - spawn: python3 failed with exit code 1 and signal 0. /usr/bin/python3: No module named pip

- ✅ OK python venv: `Ok`
- ✅ OK npm: `11.4.1`

3
  • hi, click the line with your mouse or hit enter and see what it says in the logs. Commented May 31 at 21:41
  • 1
    @KamilCuk Thanks for the info. I wasn’t aware of this option. In my case, the issue was that my .npm folder was owned by root. Changing ownership with sudo chown -R 1000:1000 "/home/your_user/.npm" fixed the problem Commented Jun 1 at 12:49
  • That's great. I very much doubt that such a solution would be useful to others with similar problem on this forum. It is highly unusual that some directory in your user directory is owned by root. Commented Jun 1 at 17:32

1 Answer 1

2

I inspected the logs by clicking the ▶ icon and pressing Enter. One of the log entries showed that my .npm directory was owned by root. I resolved it by changing the ownership with:

sudo chown -R 1000:1000 "/home/my_user/.npm"

That solved the issue.

Sign up to request clarification or add additional context in comments.

1 Comment

As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.