typescript 错误:找不到模块'./sidebars-api.js'

mxg2im7a  于 2022-11-18  发布在  TypeScript
关注(0)|答案(1)|浏览(70)

尝试启动egjs-flicking docs,但出现错误
我克隆了egjs-flicking github链接,并作为readme.md得到了我
在使用Yarn之前,安装所有根路径包npm install
和CD文档,
yarn install yarn start
我无法使用CTRL-F在项目中找到'sidebar-api.js'。但使用docusaurus会自动生成sidebar-api.js '。

[ERROR] Sidebars file at "/egjs-flicking/egjs-flicking/docs/sidebars.js" failed to be loaded.
[ERROR] Loading of version failed for version current
[ERROR] Error: Cannot find module './sidebars-api.js'
Require stack:
- /egjs-flicking/egjs-flicking/docs/sidebars.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/plugin-content-docs/lib/sidebars/index.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/plugin-content-docs/lib/index.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/core/lib/server/plugins/configs.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/core/lib/server/plugins/init.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/core/lib/server/plugins/index.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/core/lib/server/index.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/core/lib/commands/build.js
- /egjs-flicking/egjs-flicking/docs/node_modules/@docusaurus/core/lib/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
    at Function.Module._load (node:internal/modules/cjs/loader:778:27)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/egjs-flicking/egjs-flicking/docs/sidebars.js:8:6)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)

sidebar.js

module.exports = {
  docs: [
    {
      type: "autogenerated",
      dirName: "tutorials"
    }
  ],
  ...require("./sidebars-api.js")
};

package.json
第一次

相关问题