正中路桥建设发展有限公司网站,百度刷排名百度快速排名,杭州公司网站域名续费,wordpress 主题 响应mac安装部署gitbook教程 前言一、安装准备二、GitBook安装三、项目初始化 前言 一些自己实际操作的记录。 一、安装准备
Node.js gitbook基于Node.js#xff0c;所以需要提前安装。 下载地址#xff1a;https://nodejs.org/en/#xff0c;可以下载比较新的版本。(但我的建议… mac安装部署gitbook教程 前言一、安装准备二、GitBook安装三、项目初始化 前言 一些自己实际操作的记录。 一、安装准备
Node.js gitbook基于Node.js所以需要提前安装。 下载地址https://nodejs.org/en/可以下载比较新的版本。(但我的建议是不要安装太高的版本容易走很多弯路笔者使用的是10.16.3后文中提供网盘下载) 建议下载LTS版本Long Term Support)。 同时也可以网盘下载这里的版本为10.16.3 LTS 链接: https://pan.baidu.com/s/1JZLRn5EhICmsn-pLm-6Z_g 提取码: 4grf 双击打开后一直点「继续」即可。 安装完成后使用node -v可以查看版本号。
二、GitBook安装
运行命令
sudo npm install -g gitbook-cli建议科学上网速度比较快不懂怎么科学上网的朋友们可以私聊我我可以教学。 运行命令查看是否安装成功 sudo gitbook -V 但出现报错主要是因为Node.js版本较高可以尝试降低版本推荐10.x.x 但无需担心只需要修改对应的内容就好 首先进入到报错的文件中
sudo vi /usr/local/lib/node_modules/gitbook-cli/node_modules/npm/node_modules/graceful-fs/polyfills.js找到下面这三行注释掉。具体可以参考https://flaviocopes.com/cb-apply-not-a-function/ 重新运行sudo gitbook -V低版本应该会比较顺利控制台输出以下内容
CLI version: 2.3.2
Installing GitBook 3.2.3
gitbook3.2.3 ../../../../../../../../../var/folders/kj/qbpckysx1_924y0nhd59nd5r0000gn/T/tmp-16645XKlrWUKvHqkG/node_modules/gitbook
├── escape-html1.0.3
├── escape-string-regexp1.0.5
├── ignore3.1.2
├── destroy1.0.4
├── bash-color0.0.4
├── gitbook-plugin-livereload0.0.1
├── cp0.2.0
├── graceful-fs4.1.4
├── nunjucks-do1.0.0
├── github-slugid1.0.1
├── direction0.1.5
├── q1.4.1
├── spawn-cmd0.0.2
├── gitbook-plugin-fontsettings2.0.0
├── open0.0.5
├── is3.3.0
├── object-path0.9.2
├── extend3.0.2
├── json-schema-defaults0.1.1
├── gitbook-plugin-search2.2.1
├── jsonschema1.1.0
├── crc3.4.0
├── urijs1.18.0
├── semver5.1.0
├── immutable3.8.2
├── front-matter2.3.0
├── npmi2.0.1 (semver4.3.6)
├── resolve1.1.7
├── gitbook-plugin-theme-default1.0.7
├── tmp0.0.28 (os-tmpdir1.0.2)
├── dom-serializer0.1.0 (domelementtype1.1.3, entities1.1.2)
├── moment2.13.0
├── gitbook-plugin-sharing1.0.2 (lodash3.10.1)
├── error7.0.2 (string-template0.2.1, xtend4.0.2)
├── mkdirp0.5.1 (minimist0.0.8)
├── i18n-t1.0.1 (lodash4.17.21)
├── omit-keys0.1.0 (isobject0.2.0, array-difference0.0.1)
├── send0.13.2 (range-parser1.0.3, statuses1.2.1, fresh0.3.0, etag1.7.0, ms0.7.1, depd1.1.2, mime1.3.4, debug2.2.0, http-errors1.3.1, on-finished2.3.0)
├── js-yaml3.14.1 (esprima4.0.1, argparse1.0.10)
├── rmdir1.2.0 (node.flow1.2.3)
├── fresh-require1.0.3 (is-require0.0.1, shallow-copy0.0.1, astw1.3.0, sleuth0.1.1, acorn0.9.0, through20.6.5, escodegen1.14.3)
├── gitbook-plugin-lunr1.2.0 (html-entities1.2.0, lunr0.5.12)
├── gitbook-plugin-highlight2.0.2 (highlight.js9.2.0)
├── cheerio0.20.0 (entities1.1.2, css-select1.2.0, htmlparser23.8.3, jsdom7.2.2, lodash4.17.21)
├── cpr1.1.1 (rimraf2.4.5)
├── tiny-lr0.2.1 (parseurl1.3.3, livereload-js2.4.0, qs5.1.0, debug2.2.0, faye-websocket0.10.0, body-parser1.14.2)
├── gitbook-markdown1.3.2 (kramed-text-renderer0.2.1, gitbook-html1.3.3, kramed0.5.6, lodash4.17.21)
├── gitbook-asciidoc1.2.2 (gitbook-html1.3.3, lodash4.17.21, asciidoctor.js1.5.5-1)
├── request2.72.0 (tunnel-agent0.4.3, aws-sign20.6.0, oauth-sign0.8.2, forever-agent0.6.1, caseless0.11.0, is-typedarray1.0.0, stringstream0.0.6, aws41.12.0, isstream0.1.2, json-stringify-safe5.0.1, tough-cookie2.2.2, node-uuid1.4.8, qs6.1.2, combined-stream1.0.8, mime-types2.1.35, bl1.1.2, hawk3.1.3, form-data1.0.1, http-signature1.1.1, har-validator2.0.6)
├── read-installed4.0.3 (debuglog1.0.1, util-extend1.0.3, slide1.1.6, readdir-scoped-modules1.1.0, read-package-json2.1.2)
├── npm3.9.2
├── juice2.0.0 (deep-extend0.4.2, slick1.12.2, batch0.5.3, cssom0.3.1, commander2.9.0, cross-spawn-async2.2.5, web-resource-inliner2.0.0)
├── chokidar1.5.0 (path-is-absolute1.0.1, async-each1.0.6, inherits2.0.4, glob-parent2.0.0, is-binary-path1.0.1, is-glob2.0.1, fsevents1.2.13, anymatch1.3.2, readdirp2.2.1)
└── nunjucks2.5.2 (asap2.0.6, yargs3.32.0, chokidar1.7.0)
GitBook version: 3.2.3再运行sudo gitbook -V应该就显示正常的版本号了
LI version: 2.3.2
GitBook version: 3.2.3现在开始可以使用GitBook了。
三、项目初始化
可以自己新建一个目录进入到该目录下执行命令 ~ mkdir myGitBook cd myGitBook ✔ │ base Py │ at 22:54:27~/myGitBook gitbook init ✔ │ base Py │ at 22:54:46
warn: no summary file in this book
info: create README.md
info: create SUMMARY.md
info: initialization is finished会生成两个md文档README.md 是对书籍的简单介绍 SUMMARY.md 是书籍的目录结构。 然后可以通过gitbook serve编译成html格式完成以后会打开一个 web 服务器监听在本地的 4000 端口。 这样gitbook就初步搭建完成了。