0

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

enter image description here

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, }

my custom/chadrc.lua :

local M = {}

M.ui = { theme = "onedark",

-- hl_override = {
--  Comment = { italic = true },
--  ["@comment"] = { italic = true },
-- },

} M.plugins = "custom.plugins"

return M

my custom/plugins.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' When I want to install Manual typescript-language-service:

 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.

I installed and removed manytime nvchad. But can I not do that. my nvim version is 10 My nvchad version is 2.5

enter image description here

muru
  • 207,228

1 Answers1

-1

You'd normally install typescript-language-server from a JavaScript package manager such as Npm, Yarn, Pnpm...:

npm install -g typescript-language-server

and not via your editor (nvim) or IDE.

If that command doesn't work, you first need to install the package manager itself:

sudo apt install npm
P Varga
  • 512