npm install -g gitbook-cli gitbook install 如果报错,解决方法参考:gitbook初探:TypeError: cb.apply is not a function
TypeError: cb.apply is not a function 使用 nvm (Node Version Manager) 降低 node.js 版本:
如果你还没有安装 nvm,参考以下链接进行安装 Node 版本管理器 NVM 安装指南
安装所需的 Node.js 版本:
nvm install 10.14.1 切换到该版本:
nvm use 10.14.1 新建一个文件,例如 gitbook_test,进入文件夹,打开cmd,运行以下命令
gitbook init gitbook serve _book 目录,而这个目录中就是生成的本地预览的静态网站内容。 gitbook build _book 中参考:
在github上面新建一个仓库
<你的github用户名>.github.io
进入 _book 文件夹, 打开 git bash ,运行以下命令
git init git remote add origin https://github.com/zp1008611/zp1008611.github.io.git git branch -M main git add . git commit -m "Initial commit" git push -u origin main 进入 setting ,点击 page ,修改分支,点击 save
打开网址 https://<你的github用户名>.github.io.
下一篇:什么牌子性价比高主机