rafgraph / react-router-hash-link

Hash link scroll functionality for React Router
https://react-router-hash-link.rafgraph.dev
MIT License
732 stars 62 forks source link

Install fails with newer versions of NPM and RR #87

Closed neutraali closed 3 years ago

neutraali commented 3 years ago

Trying to install react-router-hash-link will fail with newer package versions. The dependencies have not been updated.

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: example-project@13.0.14
npm ERR! Found: react-router-dom@6.0.0-beta.0
npm ERR! node_modules/react-router-dom
npm ERR!   react-router-dom@"6.0.0-beta.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer react-router-dom@">=4" from react-router-hash-link@2.4.3
npm ERR! node_modules/react-router-hash-link
npm ERR!   react-router-hash-link@"2.4.3" 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.

Package versions (NodeJS 16.4.2 & NPM 7.19.1):

"react": "17.0.2"
"react-dom": "17.0.2"
"react-router": "6.0.0-beta.0"
"react-router-dom": "6.0.0-beta.0"
"react-router-hash-link": "2.4.3"
rafgraph commented 3 years ago

It’s because you’re using a beta version of react router You’ll need to use --force when installing. Beta versions have to be explicitly included in semver, which I don’t plan to do as I don’t fully test compatibility with beta versions.