Closed buxoman closed 4 years ago
Hi!
I'm having the same issue, @buxoman did you find a solution?
@yberstad I have no experience on javascript and just want to write markdown using gitbook.
Your install of gitboot
is not using graceful-fs@4.2.4 since you got this error from polyfills.js:287. From what I can tell it must be using 4.1.11 or older in one or more places. This might be fixed by reinstalling gitbook-cli
, if not this is a bug where gitbook or one of its dependencies is pulling in a broken version of graceful-fs. This issue was fixed in graceful-fs@4.2.0.
I fixed the issue by adding this to package.json (after devDependencies: {})
"resolutions": {
"**/graceful-fs": "^4.2.4"
}
It looks like the gitbook
CLI is abandoned by its developers in favor of a paid service, see https://github.com/GitbookIO/gitbook#%EF%B8%8F-deprecation-warning.
Since the graceful-fs bug was fixed nearly 4 years ago and does not require a semver-major bump nothing further can be done by us. I don't know if alternatives to gitbook
exist, this might be worth researching if the current situation is untenable for you.
I fixed the issue by adding this to package.json (after devDependencies: {})
"resolutions": { "**/graceful-fs": "^4.2.4" }
not working https://travis-ci.org/github/willin/codewars.js.cool/jobs/715362713#L204
Yeah. That also doesn't work for me.
If anyone has a working solution for this for the abandoned gitbook-cli, please let us know at https://github.com/GitbookIO/gitbook-cli/issues/110 I'll try to make a fork of gitbook-cli it so that the community has something that continues to work, but today I'm unable to fix this.
The main reason is that fs.stat support bigint since node v10.5.0:
But before v10.5.0, fs.js - Loop :
After v10.5.0, fs.js - Loop :
The simplest method is limit node version, If your can change node version:
"engines": {
"node": ">=8.11.1 < 11.15.0"
}
The once and for all method is to send a patch package for graceful-fs "stat" to support option for second param
the "engines" patch does not work with the RN community android build, the error remains. Neither the above "resolutions" patch.
is there a way to validate the setting has been indeed applied? (as it was said above, "IF you can change node version")
% uname -a Darwin xpace7 19.5.0 Darwin Kernel Version 19.5.0: Tue May 26 20:41:44 PDT 2020; root:xnu-6153.121.2~2/RELEASE_X86_64 x86_64
% npm install graceful-fs -g
% gitbook -V CLI version: 2.3.2 Installing GitBook 3.2.3 /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287 if (cb) cb.apply(this, arguments) ^
TypeError: cb.apply is not a function at /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287:18 at FSReqCallback.oncomplete (fs.js:177:5)