Getting 'npm WARN deprecated' warnings whi

2019-09-02 20:00发布

问题:

I'm getting following warnings while running npm commands, how to update these dependencies ?

npm WARN deprecated graceful-fs@3.0.8: graceful-fs version 3 and before will fail on newer node releases. Please update to graceful-fs@^4.0.0 as soon as possible.

npm WARN deprecated lodash@1.0.2: lodash@<3.0.0 is no longer maintained. Upgrade to lodash@^4.0.0.

npm WARN deprecated npmconf@2.1.1: this package has been reintegrated into npm and is now out of date with respect to npm

My package.json -

{
  "name": "lib",
  "version": "0.0.0",
  "author": {
    "name": "user",
    "email": "user@gmail.com"
  },
  "dependencies": {
    "gulp-install": "^0.6.0",
    "lodash": "^4.5.1"
  },
  "devDependencies": {
    "chai": "^1.9.1",
    "chai-jquery": "^1.2.3",
    "karma-mocha-reporter": "^0.3.1",
    "gulp": "^3.8.7",
    "gulp-concat": "^2.3.4",
    "gulp-rename": "^1.2.0",
    "gulp-uglify": "^0.3.1",
    "karma": "^0.12.22",
    "karma-chai": "^0.1.0",
    "karma-chai-jquery": "^1.0.0",
    "karma-chrome-launcher": "^0.1.4",
    "gulp-ng-annotate": "^0.3.3",
    "karma-jasmine": "^0.1.5",
    "karma-jquery": "^0.1.0",
    "karma-mocha": "^0.1.8",
    "karma-phantomjs-launcher": "^0.1.4",
    "karma-sinon-chai": "^0.2.0",
    "mocha": "^1.21.4",
    "sinon": "^1.10.3",
    "sinon-chai": "^2.5.0"
  },
  "engines": {
    "node": ">=0.8.0"
  }
}

回答1:

You have packages, which are using old versions of these plugins.

You won't get rid of these warnings, till the developers of the packages upgrading their plugins (with the dependencies).

You can print all versions with all dependencies to find the targets:

bower list --depth=2
npm list --depth=2

Increase the depth if you don't find them.