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

"tsc" missing from $PATH for typescript-language-server #222

Closed
2 tasks done
steliyan opened this issue Aug 2, 2022 · 5 comments
Closed
2 tasks done

"tsc" missing from $PATH for typescript-language-server #222

steliyan opened this issue Aug 2, 2022 · 5 comments

Comments

@steliyan
Copy link

steliyan commented Aug 2, 2022

I've made an initial investigation into the error and believe this is an error with mason.nvim (or that an improvement could be made)

  • Yes

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

  • Yes

Problem description

tsc is not found in $PATH. The problem occurs if the LSP is not attached and null-ls tried to compile the file executing the tsc executable with the current buffer contents.

Neovim version (>= 0.7)

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@iMac-Pro

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

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/local/Cellar/neovim/0.7.2_1/share/nvim"

Run :checkhealth for more info

Operating system/version

Darwin Kernel Version 19.6.0

Affected packages

typescript-language-server

Actual behavior

tsc is NOT in $PATH in neovim.

Expected behavior

tsc is in $PATH in neovim.

Mason output

mason.nvim 
                                                                      press ? 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

  Installed
    ◍ graphql-language-service-cli
    ◍ json-lsp
    ◍ lua-language-server
    ◍ typescript-language-server
  
  Available
    ◍ angular-language-server
    ◍ ansible-language-server
    ◍ apex-language-server
    ◍ arduino-language-server
    ◍ asm-lsp
    ◍ astro-language-server
    ◍ awk-language-server
    ◍ bash-language-server
    ◍ beancount-language-server
    ◍ bicep-lsp
    ◍ bsl-language-server
    ◍ clangd
    ◍ clarity-lsp
    ◍ clojure-lsp
    ◍ cmake-language-server
    ◍ codeql
    ◍ crystalline
    ◍ csharp-language-server
    ◍ css-lsp
    ◍ cssmodules-language-server
    ◍ cucumber-language-server
    ◍ deno
    ◍ dhall-lsp
    ◍ diagnostic-languageserver
    ◍ dockerfile-language-server
    ◍ dot-language-server
    ◍ efm
    ◍ elixir-ls
    ◍ elm-language-server
    ◍ ember-language-server
    ◍ emmet-ls
    ◍ erlang-ls
    ◍ esbonio
    ◍ eslint-lsp
    ◍ flux-lsp
    ◍ foam-language-server
    ◍ fortls
    ◍ fsautocomplete
    ◍ golangci-lint-langserver
    ◍ gopls
    ◍ grammarly-languageserver
    ◍ groovy-language-server
    ◍ haskell-language-server
    ◍ haxe-language-server
    ◍ hoon-language-server
    ◍ html-lsp
    ◍ intelephense
    ◍ jdtls
    ◍ jedi-language-server
    ◍ jsonnet-language-server
    ◍ julia-lsp
    ◍ kotlin-language-server
    ◍ lelwel
    ◍ lemminx
    ◍ ltex-ls
    ◍ marksman
    ◍ metamath-zero-lsp
    ◍ nickel-lang-lsp
    ◍ nimlsp
    ◍ ocaml-lsp
    ◍ omnisharp
    ◍ omnisharp-mono
    ◍ opencl-language-server
    ◍ perlnavigator
    ◍ phpactor
    ◍ powershell-editor-services
    ◍ prisma-language-server
    ◍ prosemd-lsp
    ◍ psalm
    ◍ puppet-editor-services
    ◍ purescript-language-server
    ◍ pyright
    ◍ python-lsp-server
    ◍ quick-lint-js
    ◍ r-languageserver
    ◍ reason-language-server
    ◍ remark-language-server
    ◍ rescript-lsp
    ◍ rnix-lsp
    ◍ robotframework-lsp
    ◍ rome
    ◍ rust-analyzer
    ◍ salt-lsp
    ◍ serve-d
    ◍ shopify-theme-check
    ◍ slint-lsp
    ◍ solang
    ◍ solargraph
    ◍ solidity
    ◍ sorbet
    ◍ sourcery
    ◍ sqlls
    ◍ sqls
    ◍ stylelint-lsp
    ◍ svelte-language-server
    ◍ svlangserver
    ◍ svls
    ◍ tailwindcss-language-server
    ◍ taplo
    ◍ teal-language-server
    ◍ terraform-ls
    ◍ texlab
    ◍ tflint
    ◍ vala-language-server
    ◍ verible
    ◍ vetur-vls
    ◍ vim-language-server
    ◍ visualforce-language-server
    ◍ vls
    ◍ vue-language-server
    ◍ wgsl-analyzer
    ◍ yaml-language-server
    ◍ zk
    ◍ zls

Installation log

Not really relevant.

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.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin17]`
  - OK: **RubyGem**: `2.7.3`
  - WARNING: **Composer**: not available
  - OK: **PHP**: `PHP 7.3.29 (cli) (built: Aug 15 2021 23:10:16) ( NTS )`
  - OK: **npm**: `8.5.5`
  - OK: **node**: `v16.15.0`
  - OK: **python3**: `Python 3.9.0`
  - OK: **pip3**: `pip 20.2.3 from /Users/steliyan/.pyenv/versions/3.9.0/lib/python3.9/site-packages/pip (python 3.9)`
  - OK: **javac**: `Ok`
  - OK: **java**: `openjdk version "1.8.0_292"`
  - WARNING: **julia**: not available
  - OK: **wget**: `GNU Wget 1.21.3 built on darwin19.6.0.`
  - OK: **curl**: `curl 7.64.1 (x86_64-apple-darwin19.0) libcurl/7.64.1 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.39.2`
  - OK: **gzip**: `Apple gzip 287.100.2`
  - OK: **tar**: `bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.6`
  - OK: **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-apple-darwin19.6.0)`
  - OK: **sh**: `Ok`
  - OK: GitHub API rate limit. Used: 6. Remaining: 54. Limit: 60. Reset: Tue Aug  2 09:37:45 2022.

Screenshots

No response

@williamboman
Copy link
Owner

Hello! This doesn't seem to be an installation issue? I'm not sure I'm following what the problem is, or how typescript-language-server relates to null-ls 🤔

@steliyan
Copy link
Author

steliyan commented Aug 2, 2022

Sorry, I forgot to explain the whole scenario. The built-in tsc diagnostics are configured: https://github.com/jose-elias-alvarez/null-ls.nvim/blob/main/lua/null-ls/builtins/diagnostics/tsc.lua

Which depend on the TypeScript compiler (tsc), which is installed by mason. Funny, because I didn't experience similar issues with the old version of the plugin, maybe something changed?

@williamboman
Copy link
Owner

Ah. No tsc is not installed by Mason (in some cases it is bundled with another package, but it's never exposed "globally").

Which depend on the TypeScript compiler (tsc), which is installed by mason. Funny, because I didn't experience similar issues with the old version of the plugin, maybe something changed?

If I had to guess you probably had tsc installed globally before, and since then you've upgraded/changed your Node version and in doing so lost your old global npm installations?

@steliyan
Copy link
Author

steliyan commented Aug 3, 2022

I guess it's possible, maybe something in the LSP setup changed as well. Not sure. :|

Now I am thinking of it, maybe it would be a good idea to be able to pass a path to the tsc compiler to null-ls itself. This would make sense for other tools managed by mason (for me, now it was either brew or npm -g).

What do you think about that, does it make sense?

@williamboman
Copy link
Owner

I'm pretty sure you can pass an absolute path to null-ls, if you provide the canonical name tsc it will simply look for it in PATH.

Issue Triaging automation moved this from Needs triage to Closed Aug 5, 2022
vantaboard pushed a commit to vantaboard/mason.nvim that referenced this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants