“错误TS2688:无法找到'node'的类型定义文件。”当跑步时

时间:2017-06-19 08:38:49

标签: visual-studio angular typescript gulp typescript-typings

我是Angular2的新手,所以我尝试安装this project。 我按照自述文件中的步骤操作。 这是df3 = df1.subtract(df2)

的输出
typings install

这是运行gulp时的输出:

typings install
typings WARN deprecated 2016-10-25: "registry:dt/jasmine#2.2.0+20160621224255" is deprecated (updated, replaced or remov
ed)
typings WARN deprecated 2016-9-14: "registry:dt/core-js#0.0.0+20160725163759" is deprecated (updated, replaced or remove
d)
typings WARN deprecated 2016-11-21: "registry:dt/node#6.0.0+20160909174046" is deprecated (updated, replaced or removed)


+-- core-js (global)
+-- jasmine (global)
`-- node (global)

typings.json:

[10:24:40] Using gulpfile ~\Source\Workspaces\angularExample\ng2Mvc5Demo\ng2Mvc5Demo\Gulpfile.js
[10:24:40] Starting 'scriptsNStyles'...
[10:24:40] Finished 'scriptsNStyles' after 6.31 ms
[10:24:40] Starting 'ts'...
error TS2688: Cannot find type definition file for 'node'.
error TS2688: Cannot find type definition file for 'node'.
[10:24:45] TypeScript: 1 options error
[10:24:45] TypeScript: 1 emit error
[10:24:45] TypeScript: emit failed
[10:24:45] Finished 'ts' after 4.98 s
[10:24:45] Starting 'watch.ts'...
[10:24:45] Finished 'watch.ts' after 6.96 ms
[10:24:45] Starting 'watch'...
[10:24:45] Finished 'watch' after 3.4 μs
[10:24:45] Starting 'default'...
[10:24:45] Finished 'default' after 2.27 μs

分型/ index.d.ts:

{
  "globalDependencies": {
    "core-js": "registry:dt/core-js#0.0.0+20160725163759",
    "jasmine": "registry:dt/jasmine#2.2.0+20160621224255",
    "node": "registry:dt/node#6.0.0+20160909174046"
  }
}

创建了“node”的输入文件,就像其他两个模块一样。但是gulp(和编译时的VS)仍然说他们找不到类型定义文件。

我怀疑/// <reference path="globals/core-js/index.d.ts" /> /// <reference path="globals/jasmine/index.d.ts" /> /// <reference path="globals/node/index.d.ts" /> 输出中“节点”前面的“ - ”应该告诉我一些事情,但我找不到关于此命令输出的任何文档。

感谢您的回答:)

0 个答案:

没有答案