如何修复打字已弃用的警告

时间:2016-09-14 11:11:17

标签: typescript npm asp.net-core typescript-typings

当我跑步时

npm install

我收到了很多这样的错误。

typings WARN deprecated 9/9/2016: "registry:dt/node#6.0.0+20160831021119" is deprecated (updated, replaced or removed)

我是打字稿的新手,整整几天都是一堆乱七八糟的错误只是试图从课程中获取示例网站。

我的typings.json是:

{
  "ambientDependencies": {
    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654"
  },
  "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+20160831021119",
    "body-parser": "registry:dt/body-parser#0.0.0+20160317120654",
    "compression": "registry:dt/compression#0.0.0+20160501162003",
    "cookie-parser": "registry:dt/cookie-parser#1.3.4+20160316155526",
    "es6-shim": "registry:dt/es6-shim#0.31.2+20160317120654",
    "express": "registry:dt/express#4.0.0+20160317120654",
    "express-serve-static-core": "registry:dt/express-serve-static-core#0.0.0+20160322035842",
    "mime": "registry:dt/mime#0.0.0+20160316155526",
    "serve-static": "registry:dt/serve-static#0.0.0+20160317120654"
  }
}

另外,我在哪里找到这些注册表:dt / jasmine#2.2.0 + 2 ........数字,他们真的不断更改/更新。? 如何让事情持续几天没有错误。?

我现在在没有单个网页的项目中有17,769个文件?????

1 个答案:

答案 0 :(得分:4)

今天你实际上可以use TypeScript without Typings 要获得上面列出的定义,只需从@types用户在NPM中安装它们。

npm install --save @types/core-js @types/jasmine @types/node @types/body-parser

安装包装及其包装是一个好习惯 例如。 npm i -S express @types/expressnpm i -S jasmine @types/jasmine

npm i -Snpm install --save

同义