最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【已解决】Mac中gitbook install插件autocover报错:internal child_process.js throw errnoException err spawn E2BIG

Mac crifan 1802浏览 0评论
折腾:
【未解决】gitbook安装和使用插件autocover给生成的pdf文件加上封面
期间,竟然出错了:
 gitbook install
info: installing 19 plugins using [email protected] 
info:  
info: installing plugin "autocover" 
info: install plugin "autocover" (*) from NPM with version 2.0.1 
internal/child_process.js:313
    throw errnoException(err, 'spawn');
    ^

Error: spawn E2BIG
    at ChildProcess.spawn (internal/child_process.js:313:11)
    at exports.spawn (child_process.js:508:9)
    at spawn (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/lib/utils/spawn.js:7:13)
    at runCmd_ (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/lib/utils/lifecycle.js:237:14)
    at runCmd (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/lib/utils/lifecycle.js:196:5)
    at runPackageLifecycle (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/lib/utils/lifecycle.js:160:3)
    at Array.<anonymous> (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/node_modules/slide/lib/bind-actor.js:15:8)
    at LOOP (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/node_modules/slide/lib/chain.js:15:14)
    at chain (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/node_modules/slide/lib/chain.js:20:5)
    at lifecycle_ (/Users/xxx/.gitbook/versions/3.2.3/node_modules/npm/lib/utils/lifecycle.js:131:3)
虽然报错,但是不知道具体错误
难道是缺少了,所说的node-canvas ?
Automattic/node-canvas: Node canvas is a Cairo backed Canvas implementation for NodeJS.
Pages · Automattic/node-canvas Wiki
Installation: Mac OS X · Automattic/node-canvas Wiki
直接先试试:
npm install -g canvas
然后:
 npm install -g canvas


> [email protected] install /usr/local/lib/node_modules/canvas
> node-pre-gyp install --fallback-to-build


node-pre-gyp WARN Using needle for node-pre-gyp https download 
node-pre-gyp ERR! Completion callback never invoked! 
node-pre-gyp ERR! System Darwin 18.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node@8/8.17.0/bin/node" "/usr/local/lib/node_modules/canvas/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/canvas
node-pre-gyp ERR! node -v v8.17.0
node-pre-gyp ERR! node-pre-gyp -v v0.11.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! [email protected] install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.


npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/xxx/.npm/_logs/2021-01-18T06_40_54_416Z-debug.log
不行。去试试
brew install pkg-config cairo pango libpng jpeg giflib librsvg
太慢,加上代理:
 export ALL_PROXY=socks5://127.0.0.1:51837
速度快多了。
🍺  /usr/local/Cellar/pango/1.48.0: 64 files, 2.9MB
==> Downloading https://homebrew.bintray.com/bottles/jpeg-9d.mojave.bottle.tar.gz
==> Downloading from https://d29vzk4ow07wi7.cloudfront.net/b931e7725c83275c56f962b51b83c10f31a01ac8d823c6722edaf16d893970b1?response-conten
######################################################################## 100.0%
Error: jpeg 9c is already installed
To upgrade to 9d, run `brew upgrade jpeg`.
抽空去:
brew upgrade jpeg
卡死,换代理节点,重新试试,结果:
【已解决】Mac中brew install报错:Error homebrew-core is a shallow clone
然后:
【已解决】Mac中npm install canvas报错:dyld Library not loaded icu4c libicui18n.64.dylib
  Referenced from node@8 node
最后:
 npm install -g canvas

added 72 packages in 38s
再去:
 gitbook install
info: installing 19 plugins using [email protected] 
info:  
info: installing plugin “autocover" 
...
貌似可以安装了?只剩等待?
成功安装了。
安装完毕了:
 gitbook install
info: installing 19 plugins using [email protected] 
info:  
info: installing plugin "autocover" 
info: install plugin "autocover" (*) from NPM with version 2.0.1 
info: >> plugin "autocover" installed with success 
info:  
info: installing plugin "google-adsense" 
info: install plugin "google-adsense" (*) from NPM with version 0.1.0 
info: >> plugin "google-adsense" installed with success 
info:  
info: installing plugin "theme-comscore" 
info: install plugin "theme-comscore" (*) from NPM with version 0.0.3 
info: >> plugin "theme-comscore" installed with success 
info:  
info: installing plugin "anchors" 
info: install plugin "anchors" (*) from NPM with version 0.7.1 
info: >> plugin "anchors" installed with success 
info:  
info: installing plugin "search-plus" 
info: install plugin "search-plus" (*) from NPM with version 1.0.3 
info: >> plugin "search-plus" installed with success 
info:  
info: installing plugin "disqus" 
info: install plugin "disqus" (*) from NPM with version 0.1.0 
info: >> plugin "disqus" installed with success 
info:  
info: installing plugin "prism" 
info: install plugin "prism" (*) from NPM with version 2.4.0 
info: >> plugin "prism" installed with success 
info:  
info: installing plugin "prism-themes" 
info: install plugin "prism-themes" (*) from NPM with version 0.0.2 
info: >> plugin "prism-themes" installed with success 
info:  
info: installing plugin "github-buttons" 
info: install plugin "github-buttons" (*) from NPM with version 3.0.0 
info: >> plugin "github-buttons" installed with success 
info:  
info: installing plugin "splitter" 
info: install plugin "splitter" (*) from NPM with version 0.0.8 
info: >> plugin "splitter" installed with success 
info:  
info: installing plugin "sharing-plus" 
info: install plugin "sharing-plus" (*) from NPM with version 0.0.2 
info: >> plugin "sharing-plus" installed with success 
info:  
info: installing plugin "tbfed-pagefooter" 
info: install plugin "tbfed-pagefooter" (*) from NPM with version 0.0.1 
info: >> plugin "tbfed-pagefooter" installed with success 
info:  
info: installing plugin "expandable-chapters-small" 
info: install plugin "expandable-chapters-small" (*) from NPM with version 0.1.7 
info: >> plugin "expandable-chapters-small" installed with success 
info:  
info: installing plugin "ga" 
info: install plugin "ga" (*) from NPM with version 1.0.1 
info: >> plugin "ga" installed with success 
info:  
info: installing plugin "donate" 
info: install plugin "donate" (*) from NPM with version 1.0.2 
info: >> plugin "donate" installed with success 
info:  
info: installing plugin "sitemap-general" 
info: install plugin "sitemap-general" (*) from NPM with version 0.1.1 
info: >> plugin "sitemap-general" installed with success 
info:  
info: installing plugin "copy-code-button" 
info: install plugin "copy-code-button" (*) from NPM with version 0.0.2 
info: >> plugin "copy-code-button" installed with success 
info:  
info: installing plugin "callouts" 
info: install plugin "callouts" (*) from NPM with version 0.1.1 
info: >> plugin "callouts" installed with success 
info:  
info: installing plugin "toolbar-button" 
info: install plugin "toolbar-button" (*) from NPM with version 0.0.1 
info: >> plugin "toolbar-button" installed with success 
然后去使用
还没弄好autovoer
后来遇到:
【已解决】gitbook出错:npm node_modules graceful-fs polyfills.js TypeError cb.apply is not a function
后续错误更大:
【未解决】gitbook报错:Error Couldnt locate plugins Run gitbook install to install plugins from registry

转载请注明:在路上 » 【已解决】Mac中gitbook install插件autocover报错:internal child_process.js throw errnoException err spawn E2BIG

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
82 queries in 0.160 seconds, using 22.15MB memory