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 clearoryarn clearcommand. - I have tried
rm -rf node_modules yarn.lock package-lock.jsonand 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:
- Created 2 years ago
- Reactions:3
- Comments:10 (1 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@ltribolet Yes, that means itās not entirely pnpmās fault, but more generally, about
@mdx-js/runtimebeing 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.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.