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.

Peer Dependencies updated for React 17

See original GitHub issue

Current behavior:

I’m getting errors when doing an “npm install” in my project that appear to be associated with @emotion/react.

I get this in my terminal:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR!   react@"^17.0.0" from the root project
npm ERR!   peer react@">=16.8.0" from @emotion/react@11.4.0
npm ERR!   node_modules/@emotion/react
npm ERR!     @emotion/react@"^11.4.0" from the root project
npm ERR!     @emotion/react@"^11.1.1" from react-select@4.3.0
npm ERR!     node_modules/react-select
npm ERR!       react-select@"^4.2.0" from the root project
npm ERR!   24 more (@fortawesome/react-fontawesome, @react-pdf/renderer, ...)

To reproduce:

I deleted my package-lock.json and node_modules folder and than ran “npm i”.

Expected behavior:

All my packages install without issues.

Environment information:

React 17.0.2 @emotion/react 11.4.0

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
iChenLeicommented, May 11, 2021

Yep, it’s not due to Emotion. react-pdf is the reason why you encount npm dependency errror. @mdodge-ecgrow

npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.0.0" from react-reconciler@0.24.0
npm ERR! node_modules/@react-pdf/renderer/node_modules/react-reconciler
npm ERR!   react-reconciler@"^0.24.0" from @react-pdf/renderer@1.6.16
npm ERR!   node_modules/@react-pdf/renderer
npm ERR!     @react-pdf/renderer@"^1.6.8" from the root project

react-pdf -> @react-pdf/renderer@1.6.16 -> react-reconciler@“^0.24.0” -> peer react@“^16.0.0”

“^0.24.0” === “0.24.0” <- this is the key.

https://cdn.jsdelivr.net/npm/react-reconciler@0.26.0/package.json v0.26.0 is the first version which support react@17. My suggestion is report your issue to react-pdf org repo.

https://semver.npmjs.com

2021-05-11 11 03 32

0reactions
mdodge-ecgrowcommented, May 11, 2021

Thank you

Read more comments on GitHub >

github_iconTop Results From Across the Web

Widen peer dependency range to include React 17 · Issue #814
@foaadnami the error is saying that there's a peer dependency conflict, because you've installed React 17 but next-auth currently requires React ...
Read more >
How can I get React styleguidist to install correctly and get ...
The issue is caused by npm 7's exciting new feature that automatically installs peer dependencies. This results in both React 16 ...
Read more >
npm Peer Dependencies - Fathom
Towards a deeper understanding of peer dependencies in npm. ... with React 17 and is optimistically expected to work with future minor updates...
Read more >
You must install peer dependencies warning during npm install
For example - some peer dependencies require react 16.0.8 but when I ... get warnings from other peer dependencies which requires react 17.x ......
Read more >
you must install peer dependencies yourself Code Example
npm WARN codelyzer@6.0.1 requires a peer of tslint@^5.0.0 || ^6.0.0 but none is installed. You must install peer dependencies yourself. typescript by devops ......
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