我已经使用grunt几年了,就像我永远看到以下警告一样:

npm WARN deprecated [email protected]: 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 [email protected]: lodash@<2.0.0 is no longer maintained. Upgrade to lodash@^3.0.0
npm WARN deprecated [email protected]: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.
npm WARN deprecated [email protected]: 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 [email protected]: 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)我怎么知道哪个模块已经过时,我应该怎么做?

最佳答案

弃用意味着它不会进一步开发,但也不会再改变。如果模块依赖于已弃用的程序包,而该程序包存在错误,则唯一的解决方法是升级依赖项。但是,由于没有任何变化,它会一直保持工作状态。

关于node.js - npm WARN不推荐使用xxx:我该怎么办?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/37187687/

10-10 00:16