Hi everybody
I’m new in nvim
I want to install typescript-language-service on nvim
But can I not do that
Please see all my configs and say me What should I do
my configs/lspconfig.lua :
-- EXAMPLE
local configs = require("configs.lspconfig")
local on_attach = configs.on_attach
local on_init = configs.on_init
local capabilities = configs.capabilities
local lspconfig = require "lspconfig"
local servers = { "html", "cssls", "clangd"}
for _, lsp in ipairs(servers) do
lspconfig[lsp].setup {
on_init = on_init,
on_attach = on_attach,
capabilities = capabilities,
}
end
--- typescript
lspconfig.tsserver.setup {
on_attach = on_attach,
on_init = on_init,
capabilities = capabilities,
}
-- Without the loop, you would have to manually set up each LSP
--
-- lspconfig.html.setup {
-- on_attach = on_attach,
-- capabilities = capabilities,
-- }
--
-- lspconfig.cssls.setup {
-- on_attach = on_attach,
-- capabilities = capabilities,
-- }
My custom/chadrc.lua :
-- This file needs to have same structure as nvconfig.lua
-- https://github.com/NvChad/NvChad/blob/v2.5/lua/nvconfig.lua
---@type ChadrcConfig
local M = {}
M.ui = {
theme = "onedark",
-- hl_override = {
-- Comment = { italic = true },
-- ["@comment"] = { italic = true },
-- },
}
M.plugins = "custom.plugins"
return M
My custom/plugnis.lua
local plugins = {
{
"williamboman/mason.nvim",
opts = {
ensure_installed = {
"lua-language-server",
"typescript-language-server",
"html-lsp",
"prettier",
"stylua"
},
},
},
-- In order to modify the `lspconfig` configuration:
{
"neovim/nvim-lspconfig",
config = function()
require("configs.lspconfig").defaults()
require "configs.lspconfig"
end,
},
}
return plugins
My Error Text in :MasonInstallAll :
typescript-language-server
▼ Displaying full log
Initialized npm root.
Installing npm package typescript-language-server@4.3.3…
spawn: npm failed with exit code 1 and signal 0.
My nvim version is : 0.10.0
And my NvChad Version is : 2.5