node.js – Gulp.js installation warning

Question:

I am trying to install Gulp.js locally via npm (version 3.3.12) using the following commands:

npm init
npm install --save-dev gulp

I get a warning during installation

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

After that, in the node_modules folder node_modules instead of the gulp folder, gulp get a bunch of other folders.

How to fix? How do I update my lodash version correctly?

Answer:

The situation when one of the npm packages uses deprecated dependencies periodically occurs. And this happens due to the fact that the developers of the package, for some reason, do not update the dependencies.

In fact, you don't need to be afraid of deprecated packages. This status only means that the package (or its major version) will soon be out of support. The deprecated version itself will not disappear anywhere and it is quite possible to use it (of course, if you are ready to put up with errors that no one will fix).

What you need to do:

  1. Make sure everything works
  2. Find a package with deprecated dependencies, contact its author and describe the situation.

You do not need to update anything yourself. Moreover, you simply cannot do it properly, since you are not the author / committer of the problematic package.

The fact that the node_modules directory contains more than just the gulp directory is due to the approach taken in npm@3 . To reduce dependencies, npm gets rid of duplicates by placing them as high as possible in the directory tree. Nested dependencies are used only when there is a version conflict.

Now a few words about finding the package with "rotten" dependencies. Gulp itself does not directly depend on lodash. Fortunately, the npm ls builds a complete project dependency tree from which you can figure out which package is using lodash@1.0.2 .

Scroll to Top