환경
- node v20.11.0
- npm v9.6.0
에러 현상
- node_modules 재설치 중 아래와 같은 에러가 나타난다.
npm ERR!
code ERESOLVE npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/eslint-config-prettier@6.0.0
npm ERR! Found: eslint-plugin-prettier@4.2.1
npm ERR! node_modules/eslint-plugin-prettier
npm ERR! dev eslint-plugin-prettier@"^4.0.0" from the root project
npm ERR! npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-prettier@"^3.1.0" from @vue/eslint-config-prettier@6.0.0
npm ERR! node_modules/@vue/eslint-config-prettier
npm ERR! dev @vue/eslint-config-prettier@"^6.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint-plugin-prettier@3.4.1
npm ERR! node_modules/eslint-plugin-prettier
npm ERR! peer eslint-plugin-prettier@"^3.1.0" from @vue/eslint-config-prettier@6.0.0
npm ERR! node_modules/@vue/eslint-config-prettier
npm ERR! dev @vue/eslint-config-prettier@"^6.0.0" from the root project
해결
- 프로젝트에서 필요한 버전은 node.js v14인데 실제 설치된 버전이 node.js v20여서 오류 발생
1. nvm 설치 (https://github.com/coreybutler/nvm-windows/releases)
2. 아래의 명령어를 입력한다.
nvm install 14.17.0
nvm use 14.17.0