运行gitbook init命令报错及问题解决办法

运行gitbook init命令报错,错误信息如下:

TypeError [ERR_INVALID_ARG_TYPE]: The "data" argument must be of type string or an instance of Buffer, 
TypedArray, or DataView. Received an instance of Promise

问题原因:node.js版本过高

解决办法:卸载高版本node.js,重新安装稍低版本的node.js

卸载前:

$ node -v
v14.17.0

卸载后:

$ node -v
v12.22.3

再次运行gitbook init正常。

原文地址:https://www.cnblogs.com/longying2008/p/15070305.html