williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

[angularls] Cannot install because of npm version mismatch #413

Closed kishikaisei closed 2 years ago

kishikaisei commented 2 years ago

Describe the installation issue Trying to install angularls causes the issue for node version, I have v 16.13 (LTS version), but the lsp is expecting version required: { node: '>=10.9.0 <15.0.0' }

System info (please complete the following information):

Checkhealth output (:checkhealth nvim-lsp-installer):

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - OK: **wget**: `GNU Wget 1.21.2 built on mingw32.
`
  - OK: **curl**: `curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
`
  - OK: **java**: `Ok`
  - OK: **javac**: `Ok`
  - OK: **RubyGem**: `3.3.3
`
  - OK: **pip3**: `pip 21.3.1 from C:\Users\neil.messelmani\scoop\apps\python\current\lib\site-packages\pip (python 3.10)

`
  - OK: **pip**: `pip 21.3.1 from C:\Users\neil.messelmani\scoop\apps\python\current\lib\site-packages\pip (python 3.10)

`
  - OK: **npm**: `8.1.2`
  - OK: **python3**: `Python 3.10.1
`
  - OK: **python**: `Ok`
  - OK: **node**: `v16.13.1
`
  - OK: **Ruby**: `ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x64-mingw-ucrt]
`
  - OK: **Go**: `go version go1.17.5 windows/amd64`
  - OK: **tar**: `bsdtar 3.4.3 - libarchive 3.4.3 zlib/1.2.5.f-ipp bz2lib/1.0.6 
`
  - OK: **python3_host_prog**: `Python 3.10.1
`
  - OK: **gzip**: `gzip.exe" 1.3.12`

Installation log

    ◍ angularls (failed)
        Wrote to C:\Users\neil.messelmani\AppData\Local\nvim-data\lsp_servers\angularls.tmp\package.json:

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

        npm WARN EBADENGINE Unsupported engine {
        npm WARN EBADENGINE   package: '@angular/language-server@13.1.0',
        npm WARN EBADENGINE   required: { node: '>=10.9.0 <15.0.0' },
        npm WARN EBADENGINE   current: { node: 'v16.13.1', npm: '8.1.2' }
        npm WARN EBADENGINE }

        added 8 packages, and audited 9 packages in 6s

        found 0 vulnerabilities
        Failed to promote the temporary installation directory "C:\\Users\\neil.messelmani\\AppData\\Local\\nvim-data\\lsp_servers\\angularls.tmp".
kishikaisei commented 2 years ago

It fails when running normally where tsserver for instance installs smoothly, but the installation is successful when running nvim as admin, but then, the angularls cannot be found by nvim-lsp-installer.

williamboman commented 2 years ago

Hello! Could you provide the installation logs (with debug level)? I dont believe the engine warning is causing the issues, they're just warnings

kishikaisei commented 2 years ago

So, for some reason, now that I want to install angular, it installs (with warnings), but it can't be used: image image

williamboman commented 2 years ago

Just ruling things out: does it work if you open a TypeScript file on your C: drive (that is, a TypeScript file within a git repository)?

kishikaisei commented 2 years ago

I made a folder called test under c:\test, did a git init there, and create an empty main.ts, opening it in nvim shows this: image

williamboman commented 2 years ago

I think I know what this is now. Will need to get on my Windows machine to try things out. (I believe executables installed via npm sometimes needs to be spawned via cmd.exe, like cmd.exe /C <command>)

williamboman commented 2 years ago

@kishikaisei Could you try branch fix-angularls-windows (#420) and see if it works for you? It seems like it fixes the cmd not found issue, but the server itself seems completely dead to me as it's not responding to anything (I have a feeling this is because of my local Windows env and the random test project I found on GitHub).

edit: nvm I forgot to install npm dependencies, it works fine now. I'll just go ahead and merge immediately

kishikaisei commented 2 years ago

Updated and it seems to works as expected :D image