Skip to content

[lsp][macOS][spacemacs][mise] "The package typescript is not installed. Unable to find tsserver" #5099

Description

@stradicat

Thank you for the bug report

  • I am using the latest version of lsp-mode related packages.
  • I checked FAQ and Troubleshooting sections
  • You may also try reproduce the issue using clean environment using the following command: M-x lsp-start-plain

Bug description

In Emacs + spacemacs, when opening a .js file in js2-mode with lsp + ts-ls as backend, I get the error message "Error running timer: (error "The package typescript is not installed. Unable to find tsserver")". This used to happen a couple of years ago due to an lsp upstream bug (#4254 ), then got resolved. Now it came up again.

I've installed node via mise globally and installed typescript globally with npm i -g typescript.

Despite Emacs having detected mise's node installation location and having installed typescript and typescript-language-server under ~/.emacs.d/.cache/lsp/npm where they're picked up by Emacs, the problem persists, breaking lsp-mode for javascript and typescript modes.

Javascript / Typescript are the only modes exhibiting this behavior, all other modes I use work correctly, including those that use node-based language servers (json-ls, html-ls, css-ls).

Steps to reproduce

  • Start Emacs
  • Open a .js or .tsx file
  • Check the *Messages* buffer

Expected behavior

lsp-mode is correctly enabled for javascript and typescript, loading ts-ls correctly.

Which Language Server did you use?

ts-ls

OS

MacOS

Error callstack

Anything else?

All of my toolchains are managed with mise, and all tools are correctly detected within Emacs (python, ruby, node).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions