๐ ๋ฌธ์

npm ERR! ERESOLVE unable to resolve dependency tree
npm install ๋ช ๋ น์ด ์คํํ ๋ ์๋์ ๊ฐ์ ์ค๋ฅ๋๋ฉด์ ์ค์น ์คํจํจ
Initialized git repository. Installing template dependencies using Foe error
Error: Unable to resolve dependency tree
While resolving: my-app@0.1.0
Found: react@19.0.0
node_modules/react
Peer dependency issue:
- react@18.0.0 is required by @testing-library/react@13.4.8
- Found: @testing-library/react@13.8.0 in node_modules/testing-library/react
Could not resolve dependency conflict.
Suggestions:
1. Fix the dependency conflict.
2. Retry with `--force` or `--legacy-peer-deps` to accept an incorrect dependency resolution.
For a full report, see the logs:
'C:\Users\YourUser\AppData\Local\npm-cache\logs\2025-01-01T13_00_00_666Z-resolve-report.txt'
A complete log of this run can be found in:
'C:\Users\YourUser\AppData\Local\npm-cache\logs\2025-01-01T13_00_02_506Z-debug.log'
Failed commands:
- `npm install`
- `npm install --save @testing-library/jest-dom@5.14.1 @testing-library/react@13.8.0 @testing-library/user-event@13.2.1 web-vitals@2.1.0`
โ ์์ธ
์์กด์ฑ ์ถฉ๋ ๋ฌธ์
ํ๋ก์ ํธ์์๋ react@19.0.0์ ์ค์นํ๋ ค๊ณ ํ๋๋ฐ @testing-library/react์ ํธํ๋๋ ๋ฒ์ ์ react@18.0.0 ์ด๋ผ์ ๋ฐ์ํ๋ ๋ฌธ์ ์ด๋ค. npm์ด ๋ฒ์ ์ถฉ๋์ ์๋์ผ๋ก ํด๊ฒฐํ ์ ์์ด์ ์ค์น๊ฐ ์๋ ๊ฒ์ด๋ค.
โ ํด๊ฒฐ๋ฒ
ํธํ ๋ฒ์ ํ์ธ
์๋ ๋ช ๋ น์ด ์ฐ๋ฉด @testing-library/react์ ํธํ๋๋ peerDependencies๋ฅผ ์ถ๋ ฅํด์ค๋ค.
npm info @testing-library/react peerDependencies
์๋๋ฉด package.json ํ์ผ์ ์ด์ด์ peerDependencies ๋ถ๋ถ์ ํ์ธํด๋ณด๋ฉด ํธํ๋๋ react ๋ฒ์ ์ ํ์ธํ ์ ์๋ค.
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
}
ํธํ๋๋ ๋ฒ์ ์ค์น
์๋ฅผ ๋ค์ด react@18.0.0 ์ค์นํ๋ ค๋ฉด ์๋ ๋ช ๋ น์ด์ฒ๋ผ ์ ๋ ฅํ๋ฉด ๋๋ค.
npm install react@18 react-dom@18
๊ฐ์ ์ค์น๋ --legacy๋ก ์ค์น
์๋๋ฉด ์๋ ๋ช ๋ น์ด ๋ ๊ฐ ์ค์ ํ๋ ์ ํํด์ ์ค์นํ๋ฉด ๋๋ค.
npm install --save --legacy-peer-deps
`--legacy`๋ peerDependency๊ฐ ๋ง์ง ์์๋ ์ผ๋จ ์ค์น
npm install --force
`--force`
๋ชจ๋ ์์กด์ฑ ๋ฌธ์ ๋ฅผ ๋ฌด์ํ๊ณ ๊ฐ์ ๋ก ์ค์น๋ฅผ ์งํํ๋ ๋ช ๋ น์ด(์ฌ์ฉ์ฃผ์)
package-lock.json๊ณผ ์ค์ ์์กด์ฑ ํธ๋ฆฌ๋ฅผ ๊ฐ์ ๋ก ๋ฎ์ด์ฐ๋ฉด์ ๋ง์ง ์๋ ๋ฒ์ ์ ์์กด์ฑ ๊น์ง๋ ์ถ๊ฐํ๊ฑฐ๋ ๋ณ๊ฒฝํด๋ฒ๋ฆด ์ ์๊ธฐ ๋๋ฌธ์ ์๋ชป๋ ์์กด์ฑ ๊ตฌ์กฐ๊ฐ ๋ง๋ค์ด์ ธ์ ๋์ค์ ํ๋ก์ ํธ์ ์์์น ๋ชปํ ์์กด์ฑ ๋ฒ์ ์ด๋ ์ถฉ๋์ด ํฌํจ๋ ์ ์๋ค.
์์กด์ฑ ๋ฌธ์ ๋ฅผ ๋น ๋ฅด๊ฒ ํด๊ฒฐํด์ผ ํ ๋ ์ฌ์ฉํด๋ ๋์ง๋ง ๊ฒฐ๊ณผ๋ฅผ ์์ ์ ์ผ๋ก ๋ณด์ฅํ ์๋ ์์. (์ตํ์ ์๋จ)
'ETC > ETC_Software' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ถ์คํ(BookStack API) ์ค์นํ๊ธฐ for Window 2ํธ (35) | 2025.01.03 |
---|---|
๋ถ์คํ(BookStack API) ์ค์นํ๊ธฐ for Window 1ํธ (50) | 2025.01.02 |
JSON vs XML, JSON ๋ฐฐ์ด (47) | 2024.12.26 |
[์น์ฌ์ดํธ ์ถ์ฒ] ํ์ด์ค๋ถ, ์ธ์คํ๊ทธ๋จ ์ค๋ฅ ๋ฌ๋์ง ํ์ธํ๋ ์ฌ์ดํธ (73) | 2024.12.20 |
[Excel] ์์ ํ์ฌ ์ปค์ ์์น ํ์ด๋ผ์ดํธ ํ๋ ๋ฐฉ๋ฒ (ํจ์ & ๋งคํฌ๋ก) (77) | 2024.12.19 |
๐ ๋ฌธ์

npm ERR! ERESOLVE unable to resolve dependency tree
npm install ๋ช ๋ น์ด ์คํํ ๋ ์๋์ ๊ฐ์ ์ค๋ฅ๋๋ฉด์ ์ค์น ์คํจํจ
Initialized git repository. Installing template dependencies using Foe error Error: Unable to resolve dependency tree While resolving: my-app@0.1.0 Found: react@19.0.0 node_modules/react Peer dependency issue: - react@18.0.0 is required by @testing-library/react@13.4.8 - Found: @testing-library/react@13.8.0 in node_modules/testing-library/react Could not resolve dependency conflict. Suggestions: 1. Fix the dependency conflict. 2. Retry with `--force` or `--legacy-peer-deps` to accept an incorrect dependency resolution. For a full report, see the logs: 'C:\Users\YourUser\AppData\Local\npm-cache\logs\2025-01-01T13_00_00_666Z-resolve-report.txt' A complete log of this run can be found in: 'C:\Users\YourUser\AppData\Local\npm-cache\logs\2025-01-01T13_00_02_506Z-debug.log' Failed commands: - `npm install` - `npm install --save @testing-library/jest-dom@5.14.1 @testing-library/react@13.8.0 @testing-library/user-event@13.2.1 web-vitals@2.1.0`
โ ์์ธ
์์กด์ฑ ์ถฉ๋ ๋ฌธ์
ํ๋ก์ ํธ์์๋ react@19.0.0์ ์ค์นํ๋ ค๊ณ ํ๋๋ฐ @testing-library/react์ ํธํ๋๋ ๋ฒ์ ์ react@18.0.0 ์ด๋ผ์ ๋ฐ์ํ๋ ๋ฌธ์ ์ด๋ค. npm์ด ๋ฒ์ ์ถฉ๋์ ์๋์ผ๋ก ํด๊ฒฐํ ์ ์์ด์ ์ค์น๊ฐ ์๋ ๊ฒ์ด๋ค.
โ ํด๊ฒฐ๋ฒ
ํธํ ๋ฒ์ ํ์ธ
์๋ ๋ช ๋ น์ด ์ฐ๋ฉด @testing-library/react์ ํธํ๋๋ peerDependencies๋ฅผ ์ถ๋ ฅํด์ค๋ค.
npm info @testing-library/react peerDependencies
์๋๋ฉด package.json ํ์ผ์ ์ด์ด์ peerDependencies ๋ถ๋ถ์ ํ์ธํด๋ณด๋ฉด ํธํ๋๋ react ๋ฒ์ ์ ํ์ธํ ์ ์๋ค.
"peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0" }
ํธํ๋๋ ๋ฒ์ ์ค์น
์๋ฅผ ๋ค์ด react@18.0.0 ์ค์นํ๋ ค๋ฉด ์๋ ๋ช ๋ น์ด์ฒ๋ผ ์ ๋ ฅํ๋ฉด ๋๋ค.
npm install react@18 react-dom@18
๊ฐ์ ์ค์น๋ --legacy๋ก ์ค์น
์๋๋ฉด ์๋ ๋ช ๋ น์ด ๋ ๊ฐ ์ค์ ํ๋ ์ ํํด์ ์ค์นํ๋ฉด ๋๋ค.
npm install --save --legacy-peer-deps
--legacy
๋ peerDependency๊ฐ ๋ง์ง ์์๋ ์ผ๋จ ์ค์น
npm install --force
--force
๋ชจ๋ ์์กด์ฑ ๋ฌธ์ ๋ฅผ ๋ฌด์ํ๊ณ ๊ฐ์ ๋ก ์ค์น๋ฅผ ์งํํ๋ ๋ช ๋ น์ด(์ฌ์ฉ์ฃผ์)
package-lock.json๊ณผ ์ค์ ์์กด์ฑ ํธ๋ฆฌ๋ฅผ ๊ฐ์ ๋ก ๋ฎ์ด์ฐ๋ฉด์ ๋ง์ง ์๋ ๋ฒ์ ์ ์์กด์ฑ ๊น์ง๋ ์ถ๊ฐํ๊ฑฐ๋ ๋ณ๊ฒฝํด๋ฒ๋ฆด ์ ์๊ธฐ ๋๋ฌธ์ ์๋ชป๋ ์์กด์ฑ ๊ตฌ์กฐ๊ฐ ๋ง๋ค์ด์ ธ์ ๋์ค์ ํ๋ก์ ํธ์ ์์์น ๋ชปํ ์์กด์ฑ ๋ฒ์ ์ด๋ ์ถฉ๋์ด ํฌํจ๋ ์ ์๋ค.
์์กด์ฑ ๋ฌธ์ ๋ฅผ ๋น ๋ฅด๊ฒ ํด๊ฒฐํด์ผ ํ ๋ ์ฌ์ฉํด๋ ๋์ง๋ง ๊ฒฐ๊ณผ๋ฅผ ์์ ์ ์ผ๋ก ๋ณด์ฅํ ์๋ ์์. (์ตํ์ ์๋จ)
'ETC > ETC_Software' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๋ถ์คํ(BookStack API) ์ค์นํ๊ธฐ for Window 2ํธ (35) | 2025.01.03 |
---|---|
๋ถ์คํ(BookStack API) ์ค์นํ๊ธฐ for Window 1ํธ (50) | 2025.01.02 |
JSON vs XML, JSON ๋ฐฐ์ด (47) | 2024.12.26 |
[์น์ฌ์ดํธ ์ถ์ฒ] ํ์ด์ค๋ถ, ์ธ์คํ๊ทธ๋จ ์ค๋ฅ ๋ฌ๋์ง ํ์ธํ๋ ์ฌ์ดํธ (73) | 2024.12.20 |
[Excel] ์์ ํ์ฌ ์ปค์ ์์น ํ์ด๋ผ์ดํธ ํ๋ ๋ฐฉ๋ฒ (ํจ์ & ๋งคํฌ๋ก) (77) | 2024.12.19 |