GitBook的安装卸载常见问题

8次阅读

共计 942 个字符,预计需要花费 3 分钟才能阅读完成。

Tips: 博主使用的版本
  • 博主博客地址
  • 博主 Gitbook
  • Node v8.11.2 npm v6.9.0 gitbook v3.2.3 服务器 CentOS6.5

官方 GitHub:https://github.com/GitbookIO/gitbook-cli

GitBook 相关配置及优化


一、卸载 GitBook(没有安装的跳过此步骤)

Tips: 前导摘要:记得有一次不小心卸载了一个东西,后面执行 gitbook init 报错:Cannot find module 'internal/util/types

找到C:\Users\{User}\.gitbook 找到并删除此文件夹

删除后执行命令

# npm uninstall -g gitbook
# npm uninstall -g gitbook-cli
--- 清除 npm 缓存
# npm cache clean --force

二、安装 GitBook

需要 node 环境 ➡️ Linux 或 Win 下安装 node 和 npm
需要 Git 环境 ➡️ https://www.jianshu.com/p/f2da5e76a588

# npm install gitbook -g
# npm install -g gitbook-cli
--- 如果没有安装 gitbook, 此命令会默认同时安装 GitBook
# gitbook -V
--- 列出本地所有的 gitbook 版本
# gitbook ls
Tips:GitBook 常用命令
  • gitbook -V 查看版本号
  • gitbook ls 列出本地所有的 gitbook 版本
  • gitbook init 初始化
  • gitbook install 安装插件
  • gitbook serve 预览
  • gitbook build 生成
  • gitbook build --gitbook=2.6.7 生成时指定 gitbook 的版本, 本地没有会先下载
  • gitbook uninstall 2.6.7 卸载指定版本号的 gitbook
  • gitbook fetch [version] 获取 [版本] 下载并安装 < 版本 >
  • gitbook --help 显示 gitbook-cli 帮助文档
  • gitbook help 列出 gitbook 所有的命令
  • gitbook ls-remote 列出 NPM 上的可用版本:

三、GitBook 插件


四、作者寄语

Everything is ok. But you have to do by yourself.

正文完
 0