0

I installed react version 18 but kakao-map-api was not install in 18 version, so I downgrade to react 17.2.0 but it did not work. I read the error line but I can't understand at all. Do I have to fix all in script tag from package.json file?

For example, testing-library version, emotion/react version? How can I know the version which is fit in react 17? I forcely tried command 'npm install react-kakao-maps-sdk' in cmd and of course it didn't work for same reason. I tried downgrade 17 version on command line, and also in package.json but still not work.

Complying from command line, 'fix the upstream dependency conflict', how can I know which version and which library can solve dependency problem?

Here is the error line if I commanded 'npm install react-kakao-maps-sdk'.

npm install react-kakao-maps-sdk

npm WARN config global --global, --local are deprecated. Use --location=global instead.

npm ERR! code ERESOLVE

npm ERR! ERESOLVE could not resolve

npm ERR!

npm ERR! While resolving: @testing-library/react@13.3.0

npm ERR! Found: react@17.0.2

npm ERR! node_modules/react

npm ERR! peer react@">=16.8.0" from @emotion/react@11.9.3

npm ERR! node_modules/@emotion/react

npm ERR! peer @emotion/react@"^11.0.0-rc.0" from @emotion/styled@11.9.3

npm ERR! node_modules/@emotion/styled

npm ERR! peerOptional @emotion/styled@"^11.3.0" from @mui/material@5.9.0

npm ERR! node_modules/@mui/material

npm ERR! peer @mui/material@"^5.0.0" from @mui/icons-material@5.8.4

npm ERR! node_modules/@mui/icons-material

npm ERR! 1 more (the root project)

npm ERR! 3 more (@mui/styled-engine, @mui/system, the root project)

npm ERR! peerOptional @emotion/react@"^11.5.0" from @mui/material@5.9.0

npm ERR! node_modules/@mui/material

npm ERR! peer @mui/material@"^5.0.0" from @mui/icons-material@5.8.4

npm ERR! node_modules/@mui/icons-material

npm ERR! @mui/icons-material@"^5.8.4" from the root project

npm ERR! 1 more (the root project)

npm ERR! 3 more (@mui/styled-engine, @mui/system, the root project)

npm ERR! peer react@">=16.8.0" from @emotion/styled@11.9.3

npm ERR! node_modules/@emotion/styled

npm ERR! peerOptional @emotion/styled@"^11.3.0" from @mui/material@5.9.0

npm ERR! node_modules/@mui/material

npm ERR! peer @mui/material@"^5.0.0" from @mui/icons-material@5.8.4

npm ERR! node_modules/@mui/icons-material

npm ERR! @mui/icons-material@"^5.8.4" from the root project

npm ERR! 1 more (the root project)

npm ERR! peerOptional @emotion/styled@"^11.3.0" from @mui/styled-engine@5.8.7

npm ERR! node_modules/@mui/styled-engine

npm ERR! @mui/styled-engine@"^5.8.7" from @mui/system@5.9.0

npm ERR! node_modules/@mui/system

npm ERR! @mui/system@"^5.9.0" from @mui/material@5.9.0

npm ERR! node_modules/@mui/material

npm ERR! 2 more (@mui/system, the root project)

npm ERR! 12 more (@mui/base, @mui/icons-material, @mui/material, ...)

npm ERR!

npm ERR! Could not resolve dependency:

npm ERR! peer react@"^18.0.0" from @testing-library/react@13.3.0

npm ERR! node_modules/@testing-library/react

npm ERR! @testing-library/react@"^13.3.0" from the root project npm ERR!

npm ERR! Conflicting peer dependency: react@18.2.0

npm ERR! node_modules/react

npm ERR! peer react@"^18.0.0" from @testing-library/react@13.3.0

npm ERR! node_modules/@testing-library/react

npm ERR! @testing-library/react@"^13.3.0" 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.

npm ERR!

npm ERR! See C:\Users\USER\AppData\Local\npm-cache\eresolve-report.txt for a full report.

And here is my package.json file.

{
  "name": "songpider-traveling-app",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/react": "^11.9.3",
    "@emotion/styled": "^11.9.3",
    "@mui/icons-material": "^5.8.4",
    "@mui/material": "^5.9.0",
    "@testing-library/jest-dom": "^5.16.4",
    "@testing-library/react": "^13.3.0",
    "@testing-library/user-event": "^13.5.0",
    "npm": "^8.15.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "react-router": "^6.3.0",
    "react-scripts": "^2.1.3",
    "reactstrap": "^9.1.2",
    "web-vitals": "^2.1.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}
enter code here
enter code here
chip sumi
  • 1
  • 2
  • Try uninstalling node modules completely even from the recycle bin and do npm i again. Maybe that can help – Nidhi Dadiya Jul 28 '22 at 05:22
  • Try this if it can solve. https://stackoverflow.com/questions/64936044/fix-the-upstream-dependency-conflict-installing-npm-packages – Nidhi Dadiya Jul 28 '22 at 05:23
  • I deleted node modules and package-lock.json , and used force command. I installed 17 version and it seemed work but uncaught error: invalid hook call shows up. I checked 3 reasons that react docs suggested : check dom version, hook rules, react copy but still now work. I changed test script version in json, still not work. I don't know why 17 version installation is so hard.. But thanks for comments – chip sumi Jul 28 '22 at 06:38

1 Answers1

-1
npm install --legacy-peer-deps
Chukwuemeka Maduekwe
  • 6,687
  • 5
  • 44
  • 67
  • 1
    [A code-only answer is not high quality](//meta.stackoverflow.com/questions/392712/explaining-entirely-code-based-answers). While this code may be useful, you can improve it by saying why it works, how it works, when it should be used, and what its limitations are. Please [edit] your answer to include explanation and link to relevant documentation. – Stephen Ostermiller Dec 30 '22 at 11:06