question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. ItĀ collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pnpm install fails due to @mdx-js/runtime requiring React 16

See original GitHub issue

šŸ› Bug Report

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

Docusaurus can’t be installed alongside React 17.

Steps to reproduce

Try to install this with pnpm:

  "dependencies": {
    "@docusaurus/core": "2.0.0-beta.8",
    "@docusaurus/preset-classic": "2.0.0-beta.8",
    "@docusaurus/theme-classic": "2.0.0-beta.8",
    "react": "17.0.2",
    "react-dom": "17.0.2"
  },

Expected behavior

Packages should install.

Actual behavior

It seems some deep dependency of Docusaurus has a strict React 16 requirement:

 ERR_PNPM_INVALID_PEER_DEPENDENCY  ..\..\packages\cloudvision-docs > @docusaurus/core > @docusaurus/utils: @mdx-js/runtime@1.6.22 requires a peer of react@^16.13.1 but version 17.0.2 was installed.

Your environment

  • Docusaurus version used: 2.0.0-beta.8
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Node 14.15.5
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 10

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
Josh-Cenacommented, Oct 28, 2021

@ltribolet Yes, that means it’s not entirely pnpm’s fault, but more generally, about @mdx-js/runtime being incompatible with React v17. The error stacks are pretty much the same, but one finds it during installation, another at runtime. I would investigate this deeper tomorrow.

1reaction
kaiyomacommented, Oct 28, 2021

I’m quite happy with pnpm (it has a lot of advantages over npm or yarn), so I think I’ll wait until docusaurus upgrades to MDX v2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error Codes | pnpm
ERR_PNPM_PEER_DEP_ISSUES​. pnpm install will fail if the project has unresolved peer dependencies or the peer dependencies are not matching the wanted ranges.
Read more >
pnpm/pnpm - Gitter
0 but version 15.6.2 was installed. WARN react-apollo: enzyme-adapter-react-16@1.1.1 requires a peer of enzyme@^3.0.0 but none was installed. WARN react-apollo:Ā ...
Read more >
JavaScript package managers compared: npm, Yarn, or pnpm?
js ≄ v16.9.0. However, for older Node versions, you can install it using $ npm install -g corepack .
Read more >
if you don't want pnpm to fail on peer dependency issues, add ...
I suspect the issue is due to a project config and not with ember-try itself, but am working on validating the root cause...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found