出错地方:
npm install gitbook-cli -g
gitbook -V
第一次查看gitbook版本号的时候会安装gitbook,此时爆出两个错误。
错误1:
/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
解决方法:
降低node的版本!
brew install node@10
brew unlink node
brew switch node 10.22.0