Q1: 安装问题 npm i gitbook-cli -g

npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

A1: 使用 sudo npm i gitbook-cli -g

Q2: gitbook -V

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 (node:fs:209:5)

找到对应的文件注释掉一下内容即可,在62~64行

// fs.stat = statFix(fs.stat)
// fs.fstat = statFix(fs.fstat)
// fs.lstat = statFix(fs.lstat)
powered by Gitbook该文件修订时间: 2023-08-21 16:05:47

results matching ""

    No results matching ""