每次键入npm时都会显示graceful-fs警告消息

时间:2016-12-03 14:13:17

标签: node.js npm

刚刚安装了Node 6.9.1

npm - 3.10.8

当我输入npm -v时,我收到以下警告re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.

如何摆脱这条消息?

我已尝试npm uninstall graceful-fs -gnpm install -g graceful-fs graceful-fs@latest

然后输入npm list graceful-js -g显示:

+-- 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正在使用4.1.3 - 我认为此版本不会退出。 graceful-fs。但我手动修理了它。

在此之前,我已尝试this commands

仍然在输入npm -v时,cmd会向我显示大约5-6个警告......

修改

树依赖npm list graceful-js -g 不同之处在于我刚刚全局安装了grunt

+-- 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

修改2

npm la ember-cli -g后输出为:

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

2 个答案:

答案 0 :(得分:0)

我目前的进展:

刚刚制作了一个C#控制台应用程序来读取Windows中包含' graceful-fs'的所有文件。第一个结果非常有趣: C:\NVIDIA\DisplayDriver\375.70\Win10_64\International\nodejs\NVIDIA Web Helper.exe包含Javascript代码,以及以下代码块:

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);

我已经更新了NVidia驱动程序,但目前我正在搜索它们的安装位置。我开始想知道这个警告是由司机引起的。

答案 1 :(得分:0)

经过15个小时的挖掘,我找到了解决方案:

  • 下载通过桌面上graceful-fs的最新稳定版tests
  • 转到C:\Program Files\nodejs\node_modules\npm\node_modules
  • 查找哪些软件包正在使用graceful-fs。导航到他们的node_modules文件夹,并使用Gi​​tHub中的下载文件手动替换。
  • 为所有包裹执行此操作。

就我而言,我使用的是版本3.0.8。

希望它可以帮助别人。

相关问题