补全一个错误信息,第二次遇到同类错误

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ebook@1.0.0 epub: `gitbook epub ./ ./1.epub --log debug`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ebook@1.0.0 epub 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!     ~/.npm/_logs/1-debug.log

使用 gitbook 生成 epub 格式时候 程序异常退出

错误信息不全,没有保存 大概就是下面这个错误
npm-lifecycle/index.js:332:16
error code ELIFECYCLE  
error errno 1 

排查后发现 这个锅 是 ebook-convert (calibre) 的。

是再执行下面程序时候 报错。

可以 在执行过程中 使用 ps aux |grep ebook-convert 复制 网址 的执行命令 ,复制出来后注意 部分参数值添加前后双引号 比如 --chapter=**** 改为 "--chapter=****"

 ebook-convert \
     ./ebook/SUMMARY.html \
     ./ebook/index.epub \
      --cover=./ebook/cover.jpg \
      --title=历年真题+章节题库+模拟试题】 \
      --authors=佚名 \
      --language=zh-hans \
      --book-producer=GitBook \
      --publisher=GitBook \
      --chapter="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]" \
      --level1-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]" \
      --level2-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]" \
      --level3-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]" \
      --max-levels=1 \
      --no-chapters-in-toc \
      --breadth-first \
      --dont-split-on-page-breaks
npm run build-ebook

source=./output/ebook/SUMMARY.html
cover=./output/ebook/cover.jpg
epub=1.epub
title=1
authors=佚名
ebook-convert \
     $source \
     $epub \
      --cover=$cover \
      --title=$title \
      --authors=$authors \
      --language=zh-hans \
      --book-producer=authors \
      --publisher=authors \
      --chapter="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter ')]" \
      --level1-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-1 ')]" \
      --level2-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-2 ')]" \
      --level3-toc="descendant-or-self::*[contains(concat(' ', normalize-space(@class), ' '), ' book-chapter-3 ')]" \
      --max-levels=1 \
      --no-chapters-in-toc \
      --breadth-first \
      --dont-split-on-page-breaks

请联系我 商务合作、广告投放、题目勘误、侵权投诉

点赞(2)

评论列表 共有 0 条评论

暂无评论
立即
投稿
发表
评论
返回
顶部