Skip to content
This repository has been archived by the owner on Nov 12, 2022. It is now read-only.

Volar cannot find module '/node_modules/typescript/lib/tsserverlibrary.js' #481

Closed
1 task done
DanielKohn1208 opened this issue Feb 14, 2022 · 2 comments · Fixed by #485
Closed
1 task done

Volar cannot find module '/node_modules/typescript/lib/tsserverlibrary.js' #481

DanielKohn1208 opened this issue Feb 14, 2022 · 2 comments · Fixed by #485

Comments

@DanielKohn1208
Copy link

DanielKohn1208 commented Feb 14, 2022

Problem description

After install volar wih :LspInstall volar, when opening a .vue file in a project created with vue create the following error message occurs:

`Error executing vim.schedule lua callback: /usr/share/nvim/runtime/lua/vim/lsp.lua:894: RPC[Error] code_name = Int
ernalError, message = "Request initialize failed with message: Cannot find module '/home/daniel/code/vueHard/test/
node_modules/typescript/lib/tsserverlibrary.js'\
Require stack:\
- /home/daniel/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/out/common.js\
- /home/daniel/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/out/index.js\
- /home/daniel/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/node.js\
- /home/daniel/.local/share/nvim/lsp_servers/volar/node_modules/@volar/server/bin/volar-server.js"
stack traceback:
        [C]: in function 'assert'
        /usr/share/nvim/runtime/lua/vim/lsp.lua:894: in function 'cb'
        vim.lua:285: in function <vim.lua:285>`

I was able to fix this issue by running npm install typescript typescript-language-server

Neovim version (>= 0.6)

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

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

system vimrc file: "$VIM/sysinit.vim"
fall-back for $VIM: "/usr/share/nvim"

Run :checkhealth for more info

Operating system/version

Linux danielpc 5.16.8-zen1-1-zen #1 ZEN SMP PREEMPT Tue, 08 Feb 2022 21:21:15 +0000 x86_64 GNU/Linux

I've recently downloaded the latest plugin version of both nvim-lsp-installer and nvim-lspconfig

  • Yes

Affected language servers

Volar

Actual behavior

An error is thrown when opening up a .vue files after installing volar with lsp-installer. In order for it to work, I had to run npm install typescript typescript-server

Expected behavior

I expect the language server to throw no errors and work as expected without having to install additional npm packages.

LspInstallInfo output

I cannot provide this 
The installed servers are bashls, cssls, html, lemminx,omnisharp,pyright,sumneko_lua,svelte,tsserver,vimls,volar,yamlls

Installation log

[INFO  Mon 14 Feb 2022 04:05:51 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="volar", requested_version=""
[ERROR Mon 14 Feb 2022 04:05:51 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 04:06:14 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="volar", success=true
[ERROR Mon 14 Feb 2022 04:07:58 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 04:08:16 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="vuels", requested_version=""
[INFO  Mon 14 Feb 2022 04:08:19 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="vuels", success=true
[INFO  Mon 14 Feb 2022 04:09:04 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="volar", requested_version=""
[INFO  Mon 14 Feb 2022 04:09:06 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="volar", success=true
[INFO  Mon 14 Feb 2022 04:14:17 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="volar", requested_version=""
[ERROR Mon 14 Feb 2022 04:14:17 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 04:14:37 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="volar", success=true
[ERROR Mon 14 Feb 2022 04:15:09 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 04:18:56 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="volar", requested_version=""
[ERROR Mon 14 Feb 2022 04:18:56 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 04:18:59 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="volar", success=true
[INFO  Mon 14 Feb 2022 04:19:25 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="vuels", requested_version=""
[INFO  Mon 14 Feb 2022 04:19:30 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="vuels", success=true
[ERROR Mon 14 Feb 2022 04:21:02 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 04:21:20 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="vuels", requested_version=""
[INFO  Mon 14 Feb 2022 04:21:24 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="vuels", success=true
[INFO  Mon 14 Feb 2022 04:21:31 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="volar", requested_version=""
[INFO  Mon 14 Feb 2022 04:21:50 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="volar", success=true
[ERROR Mon 14 Feb 2022 04:36:52 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 05:07:53 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="volar", requested_version=""
[ERROR Mon 14 Feb 2022 05:07:53 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 05:08:13 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="volar", success=true
[ERROR Mon 14 Feb 2022 05:20:35 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 05:20:57 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="sumneko_lua", requested_version=""
[ERROR Mon 14 Feb 2022 05:20:57 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"
[INFO  Mon 14 Feb 2022 05:20:57 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:644: Starting install server_name="svelte", requested_version=""
[INFO  Mon 14 Feb 2022 05:20:59 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="sumneko_lua", success=true
[INFO  Mon 14 Feb 2022 05:21:06 PM] ...-installer/lua/nvim-lsp-installer/ui/status-win/init.lua:663: Installation completed server_name="svelte", success=true
[ERROR Mon 14 Feb 2022 05:24:09 PM] ...rt/nvim-lsp-installer/lua/nvim-lsp-installer/process.lua:153: Failed to spawn process. cmd="gh", err="ENOENT: no such file or directory"

Healthcheck

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Ruby**: not available
  - WARNING: **RubyGem**: not available
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - WARNING: **javac**: not available
  - WARNING: **java**: not available
  - WARNING: **julia**: not available
  - OK: **tar**: `tar (GNU tar) 1.34`
  - OK: **gzip**: `gzip 1.11`
  - OK: **curl**: `curl 7.81.0 (x86_64-pc-linux-gnu) libcurl/7.81.0 OpenSSL/1.1.1m zlib/1.2.11 brotli/1.0.9 zstd/1.5.2 libidn2/2.3.2 libpsl/0.21.1 (+libidn2/2.3.0) libssh2/1.10.0 nghttp2/1.46.0`
  - OK: **wget**: `GNU Wget 1.21.2 built on linux-gnu.`
  - OK: **python3**: `Python 3.10.2`
  - OK: **node**: `v17.3.0`
  - OK: **Go**: `go version go1.17.6 linux/amd64`
  - OK: **sh**: `Ok`
  - OK: **bash**: `GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)`
  - OK: **npm**: `8.4.1`
  - OK: **pip3**: `pip 20.3.4 from /usr/lib/python3.10/site-packages/pip (python 3.10)`

Screenshots

No response

@williamboman
Copy link
Owner

williamboman commented Feb 15, 2022

Hello! Could you try branch volar-vendor-typescript (#485)? (server reinstallation will be required, because a new npm package was added)

@DanielKohn1208
Copy link
Author

DanielKohn1208 commented Feb 16, 2022

After switching branches to volar-vendor-typescript it worked perfectly and as expected. Thank you so much!

williamboman added a commit that referenced this issue Feb 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants