Vscode: Version mismatch! global tsc (2.1.5) != VS Code's language service (2.2.1)

Created on 22 Mar 2017  路  7Comments  路  Source: microsoft/vscode

I have been getting an alert popup every time I launch Code:

Version mismatch! global tsc (2.1.5) != VS Code's language service (2.2.1)

The popup has a link to a "more info" page: https://code.visualstudio.com/docs/languages/typescript#_using-newer-typescript-versions

That link is COMPLETELY USELESS for someone trying to resolve this issue normally and seems to focus entirely on providing advanced edge-case support for users who want to intentionally use different or non-standard tsc versions. It dances around what to do, and comes very close to explaining what to do, but never actually includes the critical guidance users need.

I'm sorry if I sound cranky here, but in the process of trying to resolve this issue repeatedly over the past month I found multiple bugs where other users have reported this exact same issue (driving many more users to comment on those issues) and they've all been closed with the unhelpful and ill-advised advice to "just click the don't notify me again button" or simply ignored for months:

By my reading, the first issue was closed multiple times, the first and second issues were closed without any actual attention to the root cause, and the third issue has been open for almost six months with the only visible activity being to remove it from any milestone plans.

From what I can tell, the guidance users should be given to resolve this issue is:

Assuming the alert reports that VS Code's language service is using 2.2.1 (which can also be found by opening a typescript file in the editor and looking at the version number in the lower right corner of the Code editor's status bar), open the Code terminal window and type
npm install -g [email protected]

PLEASE fix this. It's not a hard problem, it impacts users every time they launch Code, and it shouldn't be continually buried in a closed bugs stack like this.

Please note also that the page does talk about npm install typescript@version, but it's deeply buried in hugely confusing and unnecessary surrounding text and context AND the non-global install did not fix this issue for me, I needed to do a -g global to fix it. The only mention of -g is in the context of "npm list -g typescript" which is informational but irrelevant because it wont resolve the user's issue.

I've no idea how to submit a pull request on that "more info" page, so hopefully someone else can find a way to get that page fixed or change the URL of the "more info" button to point at an actually helpful page.

Most helpful comment

Even better, the alert could just have a "fix this" button that does an npm install -g [email protected] for the user

All 7 comments

Even better, the alert could just have a "fix this" button that does an npm install -g [email protected] for the user

AARGH! npm install -g [email protected] made the popup go away, but now my project reports tons of errors in global files like C:\Users\USERNAME\AppData\Roaming\npm\node_modules\typescript\lib

So instead of a warning that might or might not have pertained to a compiler error I now have a broken project.

OK, that last bit looks to be a typescript version conflict with @types/isomorphic-fetch and isomorphic-fetch. npm uninstalling those two packages cleared the errors in the main global typescript lib typings

Yeah, I hit this all the time too, and "npm install typescript -g" fixes it, but finding that solution can take some digging from what I remember. I don't think the version number is needed.

Thanks Sean, I wasn't sure whether install without the version reinstalled the current version or freshened the version. That said, it sounds like the plan of record now is to simply delete the popup, burying the issue again and making it harder for users to discover that there is a problem (that PR is here https://github.com/Microsoft/vscode/pull/23058)

My error message was Version mismatch! global tsc (2.2.2) != VS Code's language service (2.2.1). even though I had [email protected] version installed globally and it my project's workspace as well.

The comment above about "_the version number in the lower right corner of the Code editor's status bar_" was helpful to me.

If you click on this version number in the lower right corner, you are presented with a prompt whether to us VS's internal typescript or workspace's. Picking "_Use Workspace Versions_" seems to have taken care of the issue and I'm no longer presented with the mismatch prompt, which is indeed misleading not giving a clear resolution option.

We've updated the documentation on this which should address some of the original concerns: https://code.visualstudio.com/Docs/languages/typescript#_using-newer-typescript-versions

I'm still in favor of reworking or removing the tsc version check error message at some point. I've disabled it when working with JS files so now it should only show up when you open a TS file for the first time.

Take a look at the new docs and feel free to submit a PR against them if anything is unclear: https://github.com/Microsoft/vscode-docs/blob/master/docs/languages/typescript.md

Was this page helpful?
0 / 5 - 0 ratings

Related issues

biij5698 picture biij5698  路  3Comments

DovydasNavickas picture DovydasNavickas  路  3Comments

omidgolparvar picture omidgolparvar  路  3Comments

VitorLuizC picture VitorLuizC  路  3Comments

trstringer picture trstringer  路  3Comments