如何修复'fs:不支持重新评估本机模块源'-graceful-fs [英] How to fix 'fs: re-evaluating native module sources is not supported' - graceful-fs

查看:332
本文介绍了如何修复'fs:不支持重新评估本机模块源'-graceful-fs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近我已经切换到Node v.6,它开始在运行正常构建grunt/gulp/webpack时产生越来越多的问题

Recently I've made a switch to Node v.6, and It started creating more and more problems with running normal builds grunt/gulp/webpack

例如:

$ gulp
[14:02:20] Local gulp not found in ~/_Other/angular-2-ts/angular2-seed
[14:02:20] Try running: npm install gulp

在gulp和所有其他插件和模块都安装在/node_modules文件夹中(甚至通过rm -rf node_modules重新安装).

while gulp and all other plugins and modules are installed (and even re-installed via rm -rf node_modules) in /node_modules folder.

大多数错误都带有类似

(node:42) 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.

以42为任意数字

就像我提交的那个问题一样-在angular2种子回购中 https://github.com/mgechev/angular2-seed/issues/902

Like in that issue I've submitted - in angular2-seed repo https://github.com/mgechev/angular2-seed/issues/902

我试图做的是通过n( https://降级到Node v.5. www.npmjs.com/package/n )-有效.然后删除所有node_modules文件夹,然后执行

What I've tried to do is downgrade to Node v.5 via n (https://www.npmjs.com/package/n) - it worked. Then remove all node_modules folders, then do

npm info graceful-fs -v
3.3.6

好吧,让我们升级或删除并安装新的东西:

ok, lets upgrade or remove and install new:

npm i graceful-fs@latest
npm i graceful-fs@4.1.4
sudo npm i graceful-fs@4.1.4 -g

所有结果

npm info graceful-fs -v
3.3.6

因此,现在我对 graceful-fs 3.3.6 感到束手无策,甚至在某些模块相关性上更糟,例如

So now I am currenlty stuck with graceful-fs 3.3.6 or even worse in some modules dependances, like

$ angular2-seed
$ npm install

//other lines..
npm WARN deprecated graceful-fs@1.2.3: graceful-fs v3.0.0 and before 
will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 
as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

这里的策略是什么?

  • 手动修补所有包含graceful-fs< 4.0.0?
  • 是否有全局开关使用特定的软件包版本?
  • 重新安装所有内容?

推荐答案

我遇到了这个问题,并且能够通过更新npm

I had this problem and I was able to fix this by updating npm

sudo npm update -g npm

在更新之前,npm info graceful-fs | grep 'version:'的结果是:

Before the update, the result of npm info graceful-fs | grep 'version:' was:

version: '3.3.12'

更新后的结果是:

version: '3.9.3'

这篇关于如何修复'fs:不支持重新评估本机模块源'-graceful-fs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆