npm install을 하다보면 "unable to dependency tree"에러가 발생해서 설치가 안되는 경우가 있다.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: seiyon_frontend@undefined
npm ERR! Found: typescript@4.5.4
npm ERR! node_modules/typescript
npm ERR! dev typescript@"4.5.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^3.2.1" from react-scripts@3.4.4
npm ERR! node_modules/react-scripts
npm ERR! peer react-scripts@"^3.1.0" from @semantic-ui-react/craco-less@1.2.3
npm ERR! node_modules/@semantic-ui-react/craco-less
npm ERR! @semantic-ui-react/craco-less@"*" from the root project
npm ERR! peer react-scripts@"*" from @craco/craco@5.9.0
npm ERR! node_modules/@craco/craco
npm ERR! @craco/craco@"*" from the root project
npm ERR! 1 more (@semantic-ui-react/craco-less)
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!
npm7 버전 이전에는 peer dependency가 있으면 warning만 하고 설치는 됐지만, npm7부터는 에러가 발생하면서 설치가 되지 않는다.
이에 대한 대안으로 '--force' 또는 '--legacy-peer-deps' 옵션을 붙이라고 안내가 있는데
두개의 차이점은
--force : 설치하려는 패키지 버전 외 의존 버전을 추가적으로 설치한다
--legacy-peer-deps : 지난 버전들에서 해왔던것처럼 peer dependency가 맞지 않아도 설치
참고해서 진행해보도록 하자
반응형
'IT' 카테고리의 다른 글
[gitlab] root 비밀번호 변경 (0) | 2022.01.21 |
---|---|
[gitlab] root 비밀번호 변경 (0) | 2022.01.21 |
[아마추어국] 무선종사자 자격, 배치 기준 (0) | 2022.01.01 |
업무별 무선국 (0) | 2022.01.01 |
[iTerm2] 스크롤 무제한으로 늘리기 (0) | 2021.12.30 |