4

使用 tsd 命令我运行了这个命令 tsd install node

它将定义文件安装在 typings/node/node.d.ts 但我可以看到这个定义文件适用于 node.js 版本 4

Node.js v4.x API

如何为节点版本 5.11.0 安装 tsd?

4

1 回答 1

4

似乎您可以像这样安装特定类型:

npm install --save @types/node@4.0.30

对于我们的项目,我们需要匹配 aws Lambda 支持的节点版本(当前为 4.0.3)。

不知道如何获取可用类型的列表,但是当我输入不正确的值时,npm 反馈列出了可用类型:

npm 错误!没有目标
["4.0.15-alpha","4.0.16-alpha","4.0.21-alpha","4.0.22-alpha","4.0.23-alpha","4.0.24-alpha"," 4.0.25-alpha","4.0.26-alpha","4.0.27-alpha","4.0.28-alpha","4.0.29","4.0.30","6.0.31"," 6.0.32","6.0.33","6.0.34","6.0.35","6.0.36","6.0.37","6.0.38","6.0.39","6.0. 40","6.0.41","6.0.42","6.0.43","6.0.44","6.0.45","6.0.46","6.0.47"]

从这里我找出了我需要的最新版本的 4.x。

于 2016-11-15T06:08:10.070 回答