Typedoc 错误:尝试设置未声明的选项(模式)

mr_*_*ond 3 javascript node.js npm typescript typedoc

我安装了 typedoc:

npm install typedoc --save-dev
Run Code Online (Sandbox Code Playgroud)

然后将 typedocOptions 添加到 tsconfig.json 中:

{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    // ...some lines there
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2018",
      "dom"
    ],
    "emitDecoratorMetadata": true
  },
  "angularCompilerOptions": {
    "fullTemplateTypeCheck": true,
    "strictInjectionParameters": true
  },
  "typedocOptions": {
    "mode": "modules",
    "out": "docs"
  }
}
Run Code Online (Sandbox Code Playgroud)

然后我这样做:

npx typedoc --out docs src/index.ts
Run Code Online (Sandbox Code Playgroud)

并得到错误:

Error: Tried to set an option (mode) that was not declared.
Run Code Online (Sandbox Code Playgroud)

我该如何解决?

nip*_*nip 9

如发行说明中所述,该mode选项从 v0.20.0 起已被删除。完整的选项列表可以在文档中看到

相关问题在这里