查看gitbook版本gitbook -V报错:

/usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js:287
      if (cb) cb.apply(this, arguments)
                 ^

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 (fs.js:184:5)

是graceful-fs版本的问题,切换到node_modules目录下重新安装这个项目。
cd /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules

sindweller@xindeweiladeMacBook-Pro node_modules % npm install graceful-fs@la
test --save
npm notice created a lockfile as package-lock.json. You should commit this file.
+ graceful-fs@4.2.9
updated 1 package and audited 395 packages in 1.465s
found 77 vulnerabilities (7 low, 34 moderate, 31 high, 5 critical)
  run `npm audit fix` to fix them, or `npm audit` for details

然后gitbook版本可以查看。

Logo

瓜分20万奖金 获得内推名额 丰厚实物奖励 易参与易上手

更多推荐