twobin / react-lazyload

Lazy load your component, image or anything matters the performance.
MIT License
5.85k stars 487 forks source link

Installation with react 17 fails #342

Open gkpo opened 3 years ago

gkpo commented 3 years ago

I created a simple test project with react and react-dom.

Here's my package.json:

{
  "name": "test",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "react": "^17.0.1",
    "react-dom": "^17.0.1"
  }
}

Then running the command npm install react-lazyload fails

npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency tree npm ERR! npm ERR! While resolving: test@1.0.0 npm ERR! Found: react@17.0.1 npm ERR! node_modules/react npm ERR! react@"^17.0.1" from the root project npm ERR! npm ERR! Could not resolve dependency: npm ERR! peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from react-lazyload@3.1.0 npm ERR! node_modules/react-lazyload npm ERR! react-lazyload@"*" 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.

lauriharpf commented 3 years ago

Works now with react-lazyload 3.2.0, so this could be closed?

Hahet commented 2 years ago

I meet the same problem in react-lazyload@ 3.2.0 image

lzw10168 commented 2 years ago

I meet the same problem in react-lazyload@ 3.2.0 image Switch Nodejs version to 14 and try again