How to fix 'fs: re-evaluating native module sources is not supported' - graceful-fs

﹥>﹥吖頭↗ 提交于 2019-11-28 15:50:01
Asimov

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

sudo npm update -g npm

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

version: '3.3.12'

After the update the result is:

version: '3.9.3'

Type npm list graceful-fs and you will see which versions of graceful-fs are currently installed.

In my case I got:

npm list graceful-fs

@request/promise-core@0.0.1 /projects/request/promise-core
+-- gulp@3.9.1
| `-- vinyl-fs@0.3.14
|   +-- glob-watcher@0.0.6
|   | `-- gaze@0.5.2
|   |   `-- globule@0.1.0
|   |     `-- glob@3.1.21
|   |       `-- graceful-fs@1.2.3        <==== !!!
|   `-- graceful-fs@3.0.8 
`-- publish-please@2.1.3
  +-- nsp@2.4.0
  | `-- nodesecurity-npm-utils@4.0.1
  |   `-- silent-npm-registry-client@2.0.0
  |     `-- npm-registry-client@7.1.0
  |       `-- graceful-fs@4.1.3 
  `-- read-pkg@1.1.0
    `-- load-json-file@1.1.0
      `-- graceful-fs@4.1.4

As you can see gulp deep down depends on a very old version. Unfortunately, I can't update that myself using npm update graceful-fs. gulp would need to update their dependencies. So if you have a case like this you are out of luck. But you may open an issue for the project with the old dependency - i.e. gulp.

Solved this bug with reinstall gulp

npm uninstall gulp
npm install gulp

Deleting node_modules folder contents and running

npm install bower
npm install

solved the problem for me!

serv-inc

As described here, you can also attempt the command

npm cache clean

That fixed it for me, after the other steps had not fully yielded results (other than updating everything).

Just to point out that cordova brings in it's own npm with the graceful-fs dependency, so if you use Cordova make sure that it is the latest so you get the latest graceful-fs from that as well.

I was able to fix it by:

  1. updating by package.json
  2. deleting the node_modules folder
  3. executing npm install

if you are running nvm you might want to run nvm use <desired-node-version> This keeps node consistent with npm

Or try to update node:

brew upgrade node

If it is installed with brew (like in my case). sudo npm update -g npm did not solve the "same" problem for me.

The report says : a file is missing in ... vendor/win32-x64-48/binding.node

I looked for the binding.node file and I find it in...

https://github.com/sass/node-sass-binaries

Copy the correct file with the name binding.node and it works.

In the case of my Cordova-project, uninstalling and installing cordova -g fixed the problem for me.

npm uninstall -g cordova
npm install -g cordova
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!