From d60822cf20ea60615a8647c02514a3a90cbe6a6d Mon Sep 17 00:00:00 2001 From: Jason Axelson Date: Sat, 18 Dec 2021 12:09:18 -1000 Subject: [PATCH 1/2] Help users resolve no valid tsserver version error Fixes #336 --- README.md | 2 +- src/lsp-server.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 2622b2ea..dd8230f1 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Maintained by a [community of contributors](https://github.com/typescript-langua ## Installing ```sh -npm install -g typescript-language-server +npm install -g typescript-language-server typescript ``` ## Running the language server diff --git a/src/lsp-server.ts b/src/lsp-server.ts index 319e11ce..953c411b 100644 --- a/src/lsp-server.ts +++ b/src/lsp-server.ts @@ -174,7 +174,7 @@ export class LspServer { if (typescriptVersion) { this.logger.info(`Using Typescript version (${typescriptVersion.source}) ${typescriptVersion.versionString} from path "${typescriptVersion.tsServerPath}"`); } else { - throw Error('Could not find a valid tsserver version. Exiting.'); + throw Error('Could not find a valid tsserver version on $PATH. Please install tsserver with `npm install -g typescript`. Exiting.'); } this.tspClient = new TspClient({ From 7f662ba92ddf5f40935e02f24310e5e430802e25 Mon Sep 17 00:00:00 2001 From: Jason Axelson Date: Sun, 20 Feb 2022 22:12:07 +0000 Subject: [PATCH 2/2] Update wording --- src/lsp-server.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lsp-server.ts b/src/lsp-server.ts index 953c411b..d92639eb 100644 --- a/src/lsp-server.ts +++ b/src/lsp-server.ts @@ -174,7 +174,7 @@ export class LspServer { if (typescriptVersion) { this.logger.info(`Using Typescript version (${typescriptVersion.source}) ${typescriptVersion.versionString} from path "${typescriptVersion.tsServerPath}"`); } else { - throw Error('Could not find a valid tsserver version on $PATH. Please install tsserver with `npm install -g typescript`. Exiting.'); + throw Error('Could not find a valid tsserver executable in the workspace or in the $PATH. Please ensure that the "typescript" dependency is installed in either location. Exiting.'); } this.tspClient = new TspClient({