react-google-maps icon indicating copy to clipboard operation
react-google-maps copied to clipboard

Could not resolve dependency: react@"^15.0.0 || ^16.0.0" from [email protected]

Open porot07 opened this issue 4 years ago • 8 comments

Hello, I tried install react-google-maps on my project and I got error:

# npm resolution error report

2021-04-15T09:36:08.537Z

While resolving: [email protected]
Found: [email protected]
node_modules/react
  react@"^17.0.2" from the root project

Could not resolve dependency:
peer react@"^15.0.0 || ^16.0.0" from [email protected]
node_modules/react-google-maps
  react-google-maps@"*" from the root project

Fix the upstream dependency conflict, or retry
this command with --force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.

Raw JSON explanation object:

{
  "code": "ERESOLVE",
  "current": {
    "name": "react",
    "version": "17.0.2",
    "location": "node_modules/react",
    "dependents": [
      {
        "type": "prod",
        "name": "react",
        "spec": "^17.0.2",
      }
    ]
  },
  "currentEdge": {
    "type": "prod",
    "name": "react",
    "spec": "^17.0.2",
  },
  "edge": {
    "type": "peer",
    "name": "react",
    "spec": "^15.0.0 || ^16.0.0",
    "error": "INVALID",
    "from": {
      "name": "react-google-maps",
      "version": "9.4.5",
      "location": "node_modules/react-google-maps",
      "dependents": [
        {
          "type": "prod",
          "name": "react-google-maps",
          "spec": "*",
        }
      ]
    }
  },
  "peerConflict": null,
  "strictPeerDeps": false,
  "force": false
}

porot07 avatar Apr 15 '21 09:04 porot07

Same problem, any update here?

eddOrnelas avatar Apr 21 '21 02:04 eddOrnelas

@porot07 @eddOrnelas The repo of this project is unmaintained more than 3 years, and we had build new version https://www.npmjs.com/package/@react-google-maps/api

Supporting react 17 since version 2

We had rewrite it to TypeScript, and updating it frequently: https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api You can enjoy autocomplete.

You can see our docs: https://react-google-maps-api-docs.netlify.app

Also a lot of examples: https://react-google-maps-api-gatsby-demo.netlify.app/ https://github.com/JustFly1984/react-google-maps-api/tree/master/packages/react-google-maps-api-gatsby-example/src/examples

The bundle size is much smaller: https://bundlephobia.com/result?p=@react-google-maps/api 
Our Slack channel: https://join.slack.com/t/react-google-maps-api/shared_invite/enQtODc5ODU1NTY5MzQ4LTBiNTYzZmY1YmVjYzJhZThkMGU0YzUwZjJkNGJmYjk4YjQyYjZhMDk2YThlZGEzNDc0M2RhNjBmMWE4ZTJiMjQ

Enjoy!

JustFly1984 avatar Apr 21 '21 03:04 JustFly1984

@JustFly1984 yes i just found out and used the new version, sorry for asking updates before researching XD a disclaimer/note can be useful in this case :P

eddOrnelas avatar Apr 21 '21 04:04 eddOrnelas

Well since it is not maintained for more than 3+ years, it should be mentioned somewhere in https://www.npmjs.com/package/react-google-maps or https://github.com/tomchentw/react-google-maps docs that it is recommended to switch to https://www.npmjs.com/package/@react-google-maps/api :-?

DarkAng3L avatar Jun 14 '21 09:06 DarkAng3L

@DarkAng3L Nobody has access to the repo. Possibly an author died or not interested in open source anymore, so there is no option to do what you want. In general it is a good practice to look how your dependencies maintained before using it in your project. There is almost always a better alternative. I've posted to almost every issue for last 3 years.

JustFly1984 avatar Jun 14 '21 11:06 JustFly1984

@JustFly1984 thank you for forking, appreciated!

mattvb91 avatar Jun 29 '21 09:06 mattvb91

I have a React project that I build about 4 years ago. Now I'm trying to update my react project. However, I did encounter this error that's mentioned above. So how do I fix this error?

I tried npm uninstall react-google-maps but all I got was this:

➜  weather-app git:(master) ✗ npm uninstall react-google-maps
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
npm WARN   node_modules/mini-create-react-context
npm WARN     mini-create-react-context@"^0.3.0" from [email protected]
npm WARN     node_modules/react-router
npm WARN   10 more (react-dom, react-native-open-maps, react-router, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"15.5.4" from [email protected]
npm WARN node_modules/react-google-maps
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react
npm WARN   peer react@"15.5.4" from [email protected]
npm WARN   node_modules/react-google-maps
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: [email protected]
npm WARN Found: [email protected]
npm WARN node_modules/react-dom
npm WARN   react-dom@"^16.12.0" from the root project
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react-dom@"15.5.4" from [email protected]
npm WARN node_modules/react-google-maps
npm WARN
npm WARN Conflicting peer dependency: [email protected]
npm WARN node_modules/react-dom
npm WARN   peer react-dom@"15.5.4" from [email protected]
npm WARN   node_modules/react-google-maps
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from [email protected]
npm ERR!   node_modules/mini-create-react-context
npm ERR!     mini-create-react-context@"^0.3.0" from [email protected]
npm ERR!     node_modules/react-router
npm ERR!       react-router@"5.1.2" from [email protected]
npm ERR!       node_modules/react-router-dom
npm ERR!         react-router-dom@"^5.1.2" from the root project
npm ERR!   peer react@"^16.0.0" from [email protected]
npm ERR!   node_modules/react-dom
npm ERR!     react-dom@"^16.12.0" from the root project
npm ERR!   9 more (react-native-open-maps, react-router, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"18.2.0" from [email protected]
npm ERR! node_modules/react-native
npm ERR!   peer react-native@">0.45.0" from [email protected]
npm ERR!   node_modules/react-native-open-maps
npm ERR!     react-native-open-maps@"^0.3.4" from the root project
npm ERR!   peer react-native@"*" from @react-native/[email protected]
npm ERR!   node_modules/react-native/node_modules/@react-native/virtualized-lists
npm ERR!     @react-native/virtualized-lists@"^0.72.8" from [email protected]
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/react
npm ERR!   peer react@"18.2.0" from [email protected]
npm ERR!   node_modules/react-native
npm ERR!     peer react-native@">0.45.0" from [email protected]
npm ERR!     node_modules/react-native-open-maps
npm ERR!       react-native-open-maps@"^0.3.4" from the root project
npm ERR!     peer react-native@"*" from @react-native/[email protected]
npm ERR!     node_modules/react-native/node_modules/@react-native/virtualized-lists
npm ERR!       @react-native/virtualized-lists@"^0.72.8" from [email protected]
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.

What steps do I need to take to resolve those errors and update all the old packages?

kristinabressler avatar Oct 03 '23 21:10 kristinabressler