docusaurus-protobuffet icon indicating copy to clipboard operation
docusaurus-protobuffet copied to clipboard

`docusaurus-protobuffet-init init` fails to resolve dependencies

Open jgjfuture opened this issue 2 years ago • 1 comments

I ran npx docusaurus-protobuffet-init init my-test in a clean environment, but it seems to fail with the following error

The versions of node and npm are as follows.

Installing docusaurus-protobuffet with recommended plugins.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/theme-common
npm ERR!   @docusaurus/theme-common@"2.0.0-beta.6" from @docusaurus/[email protected]
npm ERR!   node_modules/@docusaurus/theme-classic
npm ERR!     @docusaurus/theme-classic@"2.0.0-beta.6" from @docusaurus/[email protected]
npm ERR!     node_modules/@docusaurus/preset-classic
npm ERR!       @docusaurus/preset-classic@"2.0.0-beta.6" from the root project
npm ERR!   @docusaurus/theme-common@"2.0.0-beta.6" from @docusaurus/[email protected]
npm ERR!   node_modules/@docusaurus/theme-search-algolia
npm ERR!     @docusaurus/theme-search-algolia@"2.0.0-beta.6" from @docusaurus/[email protected]
npm ERR!     node_modules/@docusaurus/preset-classic
npm ERR!       @docusaurus/preset-classic@"2.0.0-beta.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! @easyops-cn/docusaurus-search-local@"*" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: @docusaurus/[email protected]
npm ERR! node_modules/@docusaurus/theme-common
npm ERR!   peer @docusaurus/theme-common@"^2.0.0-rc.1" from @easyops-cn/[email protected]
npm ERR!   node_modules/@easyops-cn/docusaurus-search-local
npm ERR!     @easyops-cn/docusaurus-search-local@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /root/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-09-08T02_53_41_575Z-debug-0.log
Installation of Protobuffet preset failed.
Error: Command failed: cd my-test && npm install --save docusaurus-protobuffet @easyops-cn/docusaurus-search-local
    at checkExecSyncError (node:child_process:861:11)
    at Object.execSync (node:child_process:932:15)
    at /usr/src/app/node_modules/docusaurus-protobuffet-init/dist/index.js:61:33
    at step (/usr/src/app/node_modules/docusaurus-protobuffet-init/dist/index.js:34:23)
    at Object.next (/usr/src/app/node_modules/docusaurus-protobuffet-init/dist/index.js:15:53)
    at /usr/src/app/node_modules/docusaurus-protobuffet-init/dist/index.js:9:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/src/app/node_modules/docusaurus-protobuffet-init/dist/index.js:5:12)
    at init (/usr/src/app/node_modules/docusaurus-protobuffet-init/dist/index.js:49:12)

jgjfuture avatar Sep 08 '23 03:09 jgjfuture

While I don't believe this is the ideal solution, I'd suggest not including docusaurus-search-local, even though it's recommended.

The package specifies a certain version of @docusaurus/theme-common as peerDependencies. Considering this might change, it could be challenging to keep the version updated.

Would it be acceptable if I created a pull request aligned with this approach?

jgjfuture avatar Sep 08 '23 03:09 jgjfuture