Compiled with problems:X
ERROR in ./src/hooks/useAuth.js 3:0-32
Module not found: Error: Can't resolve 'js-cookie' in '경로'
react 실행하려니까 위와 같은 에러 발생
npm install을 실행했으나 아래 같은 npm 에러 발생.
npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: create-react-context@0.2.3
npm WARN Found: react@17.0.2
npm WARN node_modules/react
npm WARN react@"^17.0.2" from the root project
npm WARN 51 more (@ant-design/icons, @ant-design/react-slick, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from create-react-context@0.2.3
npm WARN node_modules/create-react-context
npm WARN create-react-context@"^0.2.3" from react-naver-maps@0.0.13
npm WARN node_modules/react-naver-maps
npm WARN
npm WARN Conflicting peer dependency: react@16.14.0
npm WARN node_modules/react
npm WARN peer react@"^0.14.0 || ^15.0.0 || ^16.0.0" from create-react-context@0.2.3
npm WARN node_modules/create-react-context
npm WARN create-react-context@"^0.2.3" from react-naver-maps@0.0.13
npm WARN node_modules/react-naver-maps
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-lottie@1.2.3
npm ERR! Found: react@17.0.2
npm ERR! node_modules/react
npm ERR! react@"^17.0.2" from the root project
npm ERR! peer react@">=16.0.0" from @ant-design/icons@4.7.0
npm ERR! node_modules/@ant-design/icons
npm ERR! dev @ant-design/icons@"^4.7.0" from the root project
npm ERR! @ant-design/icons@"^4.7.0" from antd@4.19.3
npm ERR! node_modules/antd
npm ERR! antd@"^4.19.3" from the root project
npm ERR! 50 more (@ant-design/react-slick, @testing-library/react, antd, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^0.14.7 || ^15.0.0 || ^16.0.0" from react-lottie@1.2.3
npm ERR! node_modules/react-lottie
npm ERR! react-lottie@"^1.2.3" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react@16.14.0
npm ERR! node_modules/react
npm ERR! peer react@"^0.14.7 || ^15.0.0 || ^16.0.0" from react-lottie@1.2.3
npm ERR! node_modules/react-lottie
npm ERR! react-lottie@"^1.2.3" 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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\USER\AppData\Local\npm-cache\_logs\2022-09-07T01_01_30_577Z-debug-0.log
에러를 잘 보면
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 install --legacy-peer-deps
하니까 됐다!!!!
왜그런지는 이제 알아봐야지...
참고 : https://stackoverflow.com/questions/64529958/error-when-trying-to-install-react-redux-dependency