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

npm install on a freshly created project produces warnings for Conflicting peer dependency #9486

Closed
6 of 7 tasks
ramnivas opened this issue Oct 31, 2023 · 5 comments · Fixed by #9566
Closed
6 of 7 tasks
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: dependencies Proposal to upgrade a dependency across major versions

Comments

@ramnivas
Copy link

Have you read the Contributing Guidelines on issues?

Prerequisites

  • I'm using the latest version of Docusaurus.
  • I have tried the npm run clear or yarn clear command.
  • I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • I have tried creating a repro with https://new.docusaurus.io.
  • I have read the console error message carefully (if applicable).

Description

npm install on a freshly created project produces warnings for Conflicting peer dependency.

npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN   react@"^18.0.0" from the root project
npm WARN   31 more (@docsearch/react, @docusaurus/core, ...)
npm WARN 
npm WARN Could not resolve dependency:
npm WARN peer react@"^15.0.2 || ^16.0.0 || ^17.0.0" from [email protected]
npm WARN node_modules/@microlink/react-json-view/node_modules/flux
npm WARN   flux@"~4.0.1" from @microlink/[email protected]
npm WARN   node_modules/@microlink/react-json-view
npm WARN 
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^15.0.2 || ^16.0.0 || ^17.0.0" from [email protected]
npm WARN   node_modules/@microlink/react-json-view/node_modules/flux
npm WARN     flux@"~4.0.1" from @microlink/[email protected]
npm WARN     node_modules/@microlink/react-json-view

Reproducible demo

No response

Steps to reproduce

  • Create a new site
npx create-docusaurus@latest my-website classic 
  • Run npm install
cd my-website
npm install

Expected behavior

No warnings produced. The site seems to work fine, but it can be confusing.

Actual behavior

Warnings produced.

Your environment

  • Public source code: (newly created Docusaurus 3.0 project)
  • Public site URL:
  • Docusaurus version used: 3.0.0
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): -
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): 18.14.1

Self-service

  • I'd be willing to fix this bug myself.
@ramnivas ramnivas added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Oct 31, 2023
@ramnivas
Copy link
Author

npm ls --all reveals that this issue is due to @docusaurus/[email protected]'s dependency on [email protected] through @microlink/[email protected].

│ ├─┬ @docusaurus/[email protected]
│ │ ├── @docusaurus/[email protected] deduped
│ │ ├── @docusaurus/[email protected] deduped
│ │ ├── @docusaurus/[email protected] deduped
│ │ ├─┬ @microlink/[email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected] deduped
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ └─┬ [email protected]
│ │ │ │ │ │   ├── UNMET OPTIONAL DEPENDENCY encoding@^0.1.0
│ │ │ │ │ │   └─┬ [email protected]
│ │ │ │ │ │     ├── [email protected]
│ │ │ │ │ │     └── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ ├── [email protected] deduped
│ │ │ │ │ ├── [email protected] deduped
│ │ │ │ │ ├─┬ [email protected]
│ │ │ │ │ │ └── [email protected]
│ │ │ │ │ ├── [email protected]
│ │ │ │ │ └── [email protected]
│ │ │ │ └── [email protected] deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ ├── [email protected]
│ │ │ │ └── [email protected]
│ │ │ ├── [email protected] deduped
│ │ │ ├── [email protected]
│ │ │ ├─┬ [email protected]
│ │ │ │ ├── @babel/[email protected] deduped
│ │ │ │ ├── [email protected] deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ │ ├─┬ [email protected]
│ │ │ │ │ └── [email protected] deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ │ └─┬ [email protected]
│ │ │ │   ├── [email protected] deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux
│ │ │ │   └─┬ [email protected]
│ │ │ │     └── [email protected] deduped invalid: "^15.0.2 || ^16.0.0 || ^17.0.0" from node_modules/@microlink/react-json-view/node_modules/flux

@Donorlin
Copy link

can confirm this issue, @microlink/react-json-view depends on flux@~4.0.1 that requires

"peerDependencies": {
    "react": "^15.0.2 || ^16.0.0 || ^17.0.0"
}

sadly it looks like https://github.com/facebookarchive/flux is not maintained anymore.

@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Nov 10, 2023
@homotechsual
Copy link
Contributor

Ah yeah ok - they bumped their node version requirement but that won't alter the flux transitive dep. Looks like we'll need a replacement JSON viewer for the debug plugin?

@homotechsual
Copy link
Contributor

Sorry that comment should have been on the PR #9494

@ogardnercertinia
Copy link

We install Docusaurus via pnpm with "strict peer dependencies" enabled, so this issue is currently blocking us from upgrading to version 3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution domain: dependencies Proposal to upgrade a dependency across major versions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants