简体   繁体   中英

How to reset VSCode Typescript Version

I have been working on a typescript project with Visual Studio Code. We are using an older version of typescript (1.8.10). This has been no problem up until now, because I have the correct ts compiler package installed locally, and I could simply click on the status bar in vscode to set the typescript version back to 1.8.10.

However, this morning, I accidentally used a 2.x keyword, and VSCode automatically bumped itself to 2.8. I realized what I did, and undid the code change.

My problem is that now that I have done that, VS Code won't let me go back to 1.8! When I click on the typescript version in the status bar, only v2.8.3 is offered, and manually typing 1.8.10 has no effect.

There must be some sort of config somewhere that is preventing me, but I can't find it. I checked my package.json file, and confirmed that we still specify the 1.8.10 compiler in the devDependencies section.

I get that I will still be compiling 1.8, but the tools/syntax guide in vscode are now following 2.8. What can I do to correct this?

You need to point the typescript.tsdk setting to your installed TypeScript version.

 "typescript.tsdk": "/Users/me/path/to/ts/lib"

After doing this, run the Select TypeScript Version command to switch over to using it

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM