如何使用 atom 指定打字稿版本

How to specify a typescript version with atom

我正在尝试弄清楚如何将特定的打字稿版本与 atom 一起使用。我有一个使用 Backbone 的旧项目,并且没有使用最新版本的打字稿进行编译,因此需要较早的版本。

我找到的最接近的答案是常见问题解答中的这个答案:

Can I use a custom TypeScript compiler? If it conforms the latest TypeScript services API then yes! Just set the path to typescriptServices.js in the package options. https://github.com/TypeStrong/atom-typescript/blob/master/docs/faq.md

我不知道该怎么做。我找到的唯一 typescriptServices.js 文件是 Visual Studio 2015 的一部分,它似乎不会影响 atom 或 atom-typescript 包。

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\Microsoft\TypeScript

如何强制 Atom 使用自定义路径编译到 tsc.exe(或至少让它使用特定版本)?

编辑

我找到了这个设置,但是安装typescript 1.0时,没有typescriptServices.js文件。有一个 tsc.js 文件,但如果我将设置更新为该文件,则会出现错误。看起来这可能是不可能的,至少对于像 1.0 这样旧的版本来说是不可能的。

I found the setting this talks about, but when installing typescript 1.0, there is no typescriptServices.js file. There is a tsc.js file, but if I update the setting to that, I get an error. It looks like this may not be possible, at least for a version as old as 1.0.

是的。这是不可能的,因为该版本甚至 API 与最新的 TypeScript 版本不兼容。

在最新版本的atom-typescript(2018年11月写的)中,它只是使用项目node_modules目录中的版本。

From the atom-typescript faq

Which version of TypeScript does atom-typescript use? Your current version installed in your node_modules. This gets determined once per open file so you might want to re-open your panes, if you've updated TypeScript in your project.