npm7+ fails to install @sanity/base with react@17
See original GitHub issueDescribe the bug
A dependency of @sanity/base
(react-sortable-hoc@^1.11.0
) only supports react up to v16, resulting in an installation failure when it’s installed alongside react@17
. Recommend to update it to react-sortable-hoc@2
for full react@17
support.
To Reproduce
Use npm7+ (i.e. node 15+) and install @sanity/base and react together
npm install @sanity/base@2.10.5 react@17.0.2
Then you’d get
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.2" from the root project
npm ERR! peer react@"^16.9 || ^17" from @sanity/base@2.10.5
npm ERR! node_modules/@sanity/base
npm ERR! @sanity/base@"2.10.5" from the root project
npm ERR! 11 more (react-dom, @reach/auto-id, @sanity/icons, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from react-sortable-hoc@1.11.0
npm ERR! node_modules/@sanity/base/node_modules/react-sortable-hoc
npm ERR! react-sortable-hoc@"^1.11.0" from @sanity/base@2.10.5
npm ERR! node_modules/@sanity/base
npm ERR! @sanity/base@"2.10.5" 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.
Expected behavior
No error. exit 0.
Which versions of Sanity are you using? 2.10.5
What operating system are you using? MacOS 11.3
Which versions of Node.js / npm are you running? node 16.2/npm 7.14
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Unable to resolve dependency tree Reactjs - Stack Overflow
I installed npm v6.7. I reinstalled Netlify CMS and Gatsby: npm install netlify-cms-app@2.9 gatsby-plugin-netlify-cms@^4.0.0.
Read more >@sanity/base - npm
Sanity plugin containing the base components and roles for a Sanity configuration. Latest version: 2.35.2, last published: a month ago.
Read more >pnpm unmet peer - You.com | The search engine you control.
Describe the bug npm create sanity@dev-preview fails with unmet peer dependencies using pnpm. ; To Reproduce npm create sanity@dev-preview ; Expected behavior.
Read more >How to Create and Publish a React Component Library
npm install react typescript @types/react --save-dev ... And finally, we will export all of our components from the base src directory:.
Read more >Bug listing with status RESOLVED with resolution OBSOLETE ...
... does not compile against postgresql-base-8.2.17" status:RESOLVED ... Bug:341151 - "dev-util/devel-chroots fails post-install sanity check" ...
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
I have a similar issue but with
@hot-loader/react-dom
:Run this in CLI: npm install react@latest react-dom@latest prop-types@latest
You can learn more about it here: https://www.sanity.io/help/upgrade-react