docusaurus-openapi: Getting started causes Error: Package subpath './lib/sidebars/generator'
Started by trying to bootstrap a normal project:
npx create-docusaurus-openapi pizza
cd pizza
npm start
After which i get this error:
[ERROR] Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/sidebars/generator' is not defined by "exports" in /Users/rasmus/Desktop/DEV/Work/pizza/node_modules/@docusaurus/plugin-content-docs/package.json
at new NodeError (internal/errors.js:322:7)
at throwExportsNotFound (internal/modules/esm/resolve.js:322:9)
at packageExportsResolve (internal/modules/esm/resolve.js:545:3)
at resolveExports (internal/modules/cjs/loader.js:450:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
at Object.<anonymous> (/Users/rasmus/Desktop/DEV/Work/pizza/node_modules/docusaurus-plugin-openapi/lib/sidebars/index.js:14:21)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:93:18)
node --version: v14.18.1
npm --version: 6.14.15
By the way, absolutely love this project! Would like to create a pull request to fix this but at the moment I have absolutely no clue how to get around this.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 7
- Comments: 29 (18 by maintainers)
It seems like Docusaurus
2.0.0-beta.15has broken some things. Even though we pin the version to2.0.0-beta.14it ends up also installing newer versions due to some of our internal dependencies. As a temporary workaround, you can add this to yourpackage.json:@bourdakos1 Thanks! This is work
@Misotech You have to help us help you, you gotta give us more to go on than “don’t work it”. What steps did you do exactly to come to your error? What happens if you reproduce exactly your steps? What is your node version, what is your yarn version?
My steps to get it to work:
@Misotech Are you using
yarnornpm? I don’t know ifnpmsupportsresolutionsin package.jsonEdit:
npmdoesn’t supportresolutions.