You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wanted to leave this here in case anyone else is having this problem. I came across this error when attempting to turn this book into a pdf. When I ran npm run setup I received this error:
/usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:278
if (cb) cb.apply(this, arguments)
^
TypeError: cb.apply is not a function
I went to the specified file and found the problematic function.
functionstatFix(orig){if(!orig)returnorig// Older versions of Node erroneously returned signed integers for// uid + gid.returnfunction(target,cb){returnorig.call(fs,target,function(er,stats){if(!stats)returncb.apply(this,arguments)if(stats.uid<0)stats.uid+=0x100000000if(stats.gid<0)stats.gid+=0x100000000if(cb)cb.apply(this,arguments)})}}
What it does, as far as I can tell, is manage some type quirks with older versions of node. In my file, it was called three times up above on lines 62-64.
I just commented out those lines and was able to install. Once I installed Calibre (brew install --cask calibre) I was able to successfully generate the pdf. As long as you have a recent version of node.js installed, this solution should work. All credit to Flaviocopes for the solution.
The text was updated successfully, but these errors were encountered:
Just wanted to leave this here in case anyone else is having this problem. I came across this error when attempting to turn this book into a pdf. When I ran
npm run setup
I received this error:I went to the specified file and found the problematic function.
What it does, as far as I can tell, is manage some type quirks with older versions of node. In my file, it was called three times up above on lines 62-64.
I just commented out those lines and was able to install. Once I installed Calibre (brew install --cask calibre) I was able to successfully generate the pdf. As long as you have a recent version of node.js installed, this solution should work. All credit to Flaviocopes for the solution.
The text was updated successfully, but these errors were encountered: