npm WARN deprecated graceful-fs@3.0.8: graceful-fs

2019-03-09 06:03发布

问题:

I am running npm install but it's giving me an error. I also tried to run below command before update. $npm install npm and also I updated graceful-fs.

$ npm install -g graceful-fs
graceful-fs@4.1.3 C:\Users\RDY672\AppData\Roaming\npm\node_modules\graceful-fs

ERROR is as below :

$ npm install -g bower@1.3.12
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 graceful-fs@2.0.3: 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 npmconf@2.1.2: this package has been reintegrated into npm and is now out of date with respect to npm
npm ERR! cb() never called!
npm ERR! not ok code 0

回答1:

TL;DR: Just file bugs if necessary, and ignore the deprecation warnings for now. Unless it's throwing errors, it's not your problem.


Most likely, it's indirectly depending on an out-of-date version of graceful-fs that depends on Node's internal modules (even though it shouldn't). That module by necessity does depend heavily on Node's implementation details, but 4.x was written to be less brittle in that respect. Few things changed in the API between 3.x and 4.x.

For what it's worth, one count a couple weeks ago had that module as the tenth most downloaded on npm. I don't see that changing much. And because of the large use share of that module (npm itself indirectly depends on an outdated version), Node has already instated a temporary fix where they're trying to get people off of the internal modules.

So don't worry unless you get errors originating from it. I generally ignore those deprecation warnings, as they're already very well known.



回答2:

npm install -g graceful-fs graceful-fs@latest works for me.

This installs the latest version of graceful-fs!!



回答3:

You don't need to worry about it and there's nothing wrong with the dependency as it only affects development. The gulp team is aware of the issue.

We are aware of the graceful-fs deprecation warning upon install of gulp 3.x.

This is due to: 1. our graceful-fs devDependency 2. the vinyl-fs dependency

Both of which we are unable to upgrade due to API breaking changes.

There is nothing wrong with the dependency, especially since it is only used in development. We will be updating or removing it in gulp 4 and the message will go away.

https://github.com/gulpjs/gulp/issues/1571



回答4:

I agree with all the comments about that it doesn't affect it at all. But in case that you want to upgrade.

First, check which versions do you already have of graceful

$ npm ls graceful-fs

and if you don't have the latest version of it then install it

$ sudo npm install -g graceful-fs graceful-fs@latest-version


回答5:

I am using the Windows platform and Homestead. The following commands in the console work for me:

npm install --no-bin-links
gulp
npm rebuild node-sass
gulp