- Installing Nodejs
- http://nodejs.cn/download/
- CNPM installation Gitbook
- Unzip the book file and CD to the book file directory
- Gitbook serve
- Browser Access localhost:4000
Install Nodejs in Windows first
Official website: https://nodejs.org/en/
Install directly after download
Then the DOS command window is tested by CMD to see if the installation is complete.
Input Command: node
Input:
Console.log ("hello,world!");
Test it.
Set up an app folder under D, and write a test.js in the app folder.
The code is as follows:
var http = require ("http");
Http.createserver (function (req, res) {
Res.writehead ($, {"Content-type": "Text/html"});
Res.write ("
Res.write ("<p>hello world</p>");
Res.end ("<p>beyondweb.cn</p>")
}). Listen (3000);
Console.log ("HTTP server is listening at Port 3000.");
Once you've edited the file.
Then enter your app's folder from the DOS window and execute "node Test.js" in the command window. This will allow you to access your JS on the Web page. Visit URL http://127.0.0.1:3000. If you have a normal access, then the installation is successful.
Nodejs installation was successful.
Next
Build Gitbook Platform
Enter a command to install Gitbook globally.
NPM Install Gitbook-cli-g
Since the installation process uses foreign mirrors by default, you may consider switching the domestic mirror.
In the cmd window, enter
mkdir MyBook Creating a folder
Switch to the directory.
After you switch the folder, enter the following command in the current file directory in the window
Gitbook init//initialization directory file
After initialization
Gitbook after installation.
- Unzip the book file and CD to the book file directory
Gitbook serve
You can then enter Http://127.0.0.1:4000/to access the
1, need to install node. js. Go to the official website to download the corresponding version can be https://nodejs.org/en/
2, install CNPM, in fact, install NPM can also.
NPM Install Cnpm-g--registry=https://registry.npm.taobao.org
3, CNPM install-g gitbook-cli
4. CD to the file directory to view
5, Gitbook serve
6, http://127.0.0.1:4000/Browser View ebook This simple
Gitbook installation and use of Windows build Gitbook platform