系统环境:
mac 10.12.6
node v12.16.1
mpm 6.13.4
我有一个需求,将github上的wiki(https://github.com/alibaba/Sentinel/wiki
)导出未pdf文件。所以找到了下面方法:
如何将 github 上的开源书籍转换成 pdf?
然后在安装 gitbook过程中出错了。
安装出错提示如下:
➜ Sentinel.wiki git:(master) ✗ node
Welcome to Node.js v12.16.1.
➜ Sentinel.wiki git:(master) ✗ npm -v
6.13.4
➜ Sentinel.wiki git:(master) ✗ ls /usr/local/bin/npm
/usr/local/bin/npm
➜ Sentinel.wiki git:(master) ✗ ll /usr/local/bin/npm
lrwxr-xr-x 1 root admin 38B 3 7 12:44 /usr/local/bin/npm -> ../lib/node_modules/npm/bin/npm-cli.js
➜ Sentinel.wiki git:(master) ✗ sudo npm install gitbook -g
Password:
npm WARN deprecated graceful-fs@3.0.5: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
npm WARN deprecated nunjucks@2.2.0: potential XSS vulnerability in autoescape mode, and with escape filter was fixed in v2.4.3
npm WARN deprecated request@2.51.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated fsevents@0.3.8: Way too old
npm WARN deprecated minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated sprintf@0.1.5: The sprintf package is deprecated in favor of sprintf-js.
npm WARN deprecated datauri@0.2.1: Datauri 2.0 released. See more in https://github.com/data-uri/datauri/releases/tag/v2.0.0
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN deprecated hawk@1.1.1: This module moved to @hapi/hawk. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated sntp@0.2.4: This module moved to @hapi/sntp. Please make sure to switch over as this distribution is no longer supported and may contain bugs and critical security issues.
npm WARN deprecated boom@0.4.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated cryptiles@0.2.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
npm WARN deprecated hoek@0.9.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
/usr/local/bin/gitbook -> /usr/local/lib/node_modules/gitbook/bin/gitbook.js
> fsevents@0.3.8 install /usr/local/lib/node_modules/gitbook/node_modules/fsevents
> node-gyp rebuild
gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/lisan/Library/Caches/node-gyp/12.16.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/gitbook/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/gitbook/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/gitbook/node_modules/fsevents
gyp ERR! node -v v12.16.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@0.3.8 (node_modules/gitbook/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@0.3.8 install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ gitbook@2.6.9
added 404 packages from 562 contributors in 190.433s
安装完后虽然出错了,但是gitbook命令还是能使用,然后导出的pdf有问题,是一个空白pdf。
我怀疑是gitbook的问题,想重新不报错安装。但是安装过程中还是报错了,想去官方github提issue,但是发官方github不提供后续维护了。说白了是没人管。
做个记录,让后面的小伙伴看到。
网友评论