Gitbook installation and use of Windows build Gitbook platform

Source: Internet
Author: User
Tags install node

    • 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.