graceful-fs warning messages each time when type n

2019-06-02 19:09发布

问题:

Just installed Node 6.9.1

npm - 3.10.8

When I type npm -v I am receiving the following warning re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

How to get rid off this message?

I've tried npm uninstall graceful-fs -g,
npm install -g graceful-fs graceful-fs@latest.

Then type npm list graceful-js -g shows:

+-- ember-cli@2.6.0 | +-- bower-config@1.4.0 | | `-- graceful-fs@4.1.11 | `-- npm@2.15.1 | `-- graceful-fs@4.1.11 `-- graceful-fs@4.1.11

npm@2.15.1 was using 4.1.3 - I think this version doesn't exits. graceful-fs. but I have fix it manually.

Before that I've tried this commands

And still when type npm -v, cmd shows me a around 5-6 warnings ...

Edit

tree dependency npm list graceful-js -g The difference is that I just installed grunt globally

+-- ember-cli@2.10.0 | +-- bower-config@1.4.0 | | `-- graceful-fs@4.1.11 | `-- npm@3.10.8 | `-- graceful-fs@4.1.6 +-- graceful-fs@4.1.11 `-- grunt@1.0.1 `-- dateformat@1.0.12 `-- meow@3.7.0 `-- read-pkg-up@1.0.1 `-- read-pkg@1.1.0 `-- load-json-file@1.1.0 `-- graceful-fs@4.1.11

Edit 2

After npm la ember-cli -g The output is :

Command line tool for developing ambitious ember.js apps
git+https://github.com/ember-cli/ember-cli.git
https://ember-cli.com/

回答1:

My current progress:

Just made a C# console application to read all files in the Windows that contains 'graceful-fs'. The first result was very interesting: C:\NVIDIA\DisplayDriver\375.70\Win10_64\International\nodejs\NVIDIA Web Helper.exe that contains Javascript code, and the following code block:

if (e.code !== 'MODULE_NOT_FOUND') {throw e};

// TODO(ChALkeR): remove this in master after 6.x
// This code was based upon internal/util and is required to give users
// a grace period before actually breaking modules that re-evaluate fs
// sources from context where internal modules are not allowed, e.g.
// older versions of graceful-fs module.

const prefix = `(${process.release.name}:${process.pid}) `;

printDeprecation = function(msg, warned) {
if (process.noDeprecation)
  return true;

if (warned)
  return warned;

if (process.throwDeprecation)
  throw new Error(`${prefix}${msg}`);
else if (process.traceDeprecation)
  console.trace(msg);
else
  console.error(`${prefix}${msg}`);

return true;
};
printDeprecation('fs: re-evaluating native module sources is not ' +
               'supported. If you are using the graceful-fs module, ' +
               'please update it to a more recent version.',
                false);

I've updated NVidia Drivers, but currently I searching where they are installed. I start wondering the warning is caused by drivers.



回答2:

After 15 hours of digging, I found the solution:

  • Download the latest stable version of graceful-fs that pass the tests on your desktop.
  • Go to C:\Program Files\nodejs\node_modules\npm\node_modules
  • find which of the packages are using graceful-fs. Navigate to their node_modules folders and replace manually with downloaded files from GitHub.
  • Do this for all packages.

In my case I used version 3.0.8.

Hope it can help someone.



标签: node.js npm