npm WARN弃用xxx:我该怎么办?

时间:2016-05-12 12:59:44

标签: node.js npm gruntjs warnings lodash

我几年来一直在使用咕噜声,而且它已经像我一样看到了以下警告:

npm WARN deprecated win-spawn@2.0.0: use [cross-spawn](https://github.com/IndigoUnited/node-cross-spawn) or [cross-spawn-async](https://github.com/IndigoUnited/node-cross-spawn-async) instead.
npm WARN deprecated lodash@0.9.2: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before will fail on node releases >= v6.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.
npm WARN deprecated lodash@2.2.1: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.

我的项目实际上仍在工作,即使有这些警告。从第一天开始,lodash通常会给我一个警告。

这是产生这些错误的package.json文件:

{
  "name": "xxx",
  "version": "0.1.1",
  "devDependencies": {
    "autoprefixer": "^6.2.3",
    "cssnano": "^3.4.0",
    "grunt": "^0.4.5",
    "grunt-browser-sync": "^1.5.3",
    "grunt-contrib-clean": "^1.0.0",
    "grunt-contrib-concat": "~0.5.0",
    "grunt-contrib-copy": "^1.0.0",
    "grunt-contrib-htmlmin": "^0.6.0",
    "grunt-contrib-imagemin": "^1.0.0",
    "grunt-contrib-sass": "~0.7.4",
    "grunt-contrib-uglify": "~0.5.1",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-critical": "^0.2.0",
    "grunt-delete-sync": "0.0.2",
    "grunt-newer": "^0.7.0",
    "grunt-postcss": "^0.7.1",
    "grunt-processhtml": "^0.3.13"
  }
}

我猜某些模块或依赖项已过时,但......

1)为什么它仍然有效?忽略警告是否安全? 2)我怎么知道哪个模块已经过时以及我应该怎么做呢?

1 个答案:

答案 0 :(得分:1)

弃用意味着它没有进一步发展,但也不会再发生变化。如果一个模块依赖于一个有bug的已弃用的软件包,唯一的解决方法就是升级依赖项。但是,由于没有任何改变,因此它会一直有效。