Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在book.jason中排除无关文件,运行book sm 提示失败 #28

Open
fang-yu opened this issue Feb 1, 2018 · 1 comment
Open

在book.jason中排除无关文件,运行book sm 提示失败 #28

fang-yu opened this issue Feb 1, 2018 · 1 comment

Comments

@fang-yu
Copy link

fang-yu commented Feb 1, 2018

Hi:

感谢你的共享的插件。我在部署的过程中,因为默认book sm会把node module 和_book的都收录到目录里面,想要把这两个目录排除,因此我在book.json中增加了如下代码:

{
    "bookname": "json-config-name",
    "outputfile": "test.md",
    "catalog": "all",  // 如 [chapter1,chapter2, ...]
    "ignores": [_drafts,_books],
    "unchanged": [] // 如: ['myApp'] -> `myApp` not `My App`
}

但是再次运行book sm的时候,提示以下错误:

module.js:593
    throw err;
    ^

SyntaxError: /Users/aban/Documents/半撇私塾课程/BPteach-EDU-Chanllenger/book.json: Unexpected token / in JSON at position 173
    at JSON.parse (<anonymous>)
    at Object.Module._extensions..json (module.js:590:27)
    at Module.load (module.js:490:32)
    at tryModuleLoad (module.js:449:12)
    at Function.Module._load (module.js:441:3)
    at Module.require (module.js:500:17)
    at require (internal/module.js:20:19)
    at BookConfig (/Users/aban/.nvm/versions/node/v7.1.0/lib/node_modules/gitbook-summary/lib/bookJson.js:10:18)
    at init (/Users/aban/.nvm/versions/node/v7.1.0/lib/node_modules/gitbook-summary/lib/summary/index.js:29:22)
    at Array.init (/Users/aban/.nvm/versions/node/v7.1.0/lib/node_modules/gitbook-summary/lib/summary/index.js:51:13)

相关的配置信息:

  • Mac
  • Node版本:7.1.0
  • npm版本:3.10.9
  • Gitbook CLI 版本: 2.3.2
@anlia260
Copy link

ignores 更改下忽略目录就好。

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants