npm run serve
실행하면 나타나는 오류opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
library: 'digital envelope routines',
reason: 'unsupported',
code: 'ERR_OSSL_EVP_UNSUPPORTED'
이 오류는 주로 Node.js 17 버전 이후에서 발생합니다. Node.js 17 이상에서는 OpenSSL 3.0을 기본으로 사용하며, 일부 암호화 알고리즘에 대한 지원이 중단되었습니다. Node.js 16 버전 이하로 다운그레이드하면 해결될 수 있습니다.
Node.js 버전을 관리하는 도구인 nvm
을 사용하여 Node.js 16 버전으로 변경할 수 있습니다:
nvm install 16
nvm use 16
npm run serve
실행 시 나타나는 오류ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR! dev eslint@"^6.8.0" from the root project
npm ERR! peer eslint@">=6.2.2" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^5.1.2" from the root project
npm ERR! 2 more (eslint-plugin-import, eslint-plugin-node)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint@"^7.0.0 || ^8.0.0 || ^9.0.0" from [email protected]
npm ERR! node_modules/eslint-plugin-promise
npm ERR! peer eslint-plugin-promise@">= 4.2.1" from @vue/[email protected]
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^5.1.2" 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 /home/jiun/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/jiun/.npm/_logs/2024-10-15T00_21_16_774Z-debug-0.log
npm
이나 yarn
과 같은 패키지 매니저를 사용할 때, 의존성 간의 버전 충돌이 발생했을 때 나타납니다. 이 문제는 서로 호환되지 않는 여러 버전의 패키지가 동시에 설치되려 할 때 발생합니다.-force
또는 -legacy-peer-deps
옵션 사용:
npm install --force
또는
npm install --legacy-peer-deps
-legacy-peer-deps
는 Node.js 7 이전 방식으로 의존성을 설치합니다. 일반적으로 이 방법이 -force
보다 더 안전하게 충돌을 해결할 수 있습니다.의존성 버전 확인 및 수동 수정:
package.json
파일에서 충돌을 일으키는 의존성의 버전을 수동으로 맞추는 방법입니다. 먼저 충돌된 패키지를 확인한 후, package.json
에서 해당 패키지의 버전을 수동으로 수정할 수 있습니다.충돌 패키지 이름과 버전 정보를 확인하려면 다음 명령을 사용할 수 있습니다:
npm ls <패키지명>
npm update <패키지명>
그런 다음, 의존성 버전을 수정한 후 다시 npm install
을 시도하세요.
패키지 잠금 파일 삭제 후 다시 설치: (사용한 방법)
package-lock.json
또는 yarn.lock
파일에 의존성 충돌 정보가 저장되어 있을 수 있습니다. 이를 삭제한 후 새로 패키지를 설치하면 문제가 해결될 수 있습니다.rm -rf node_modules package-lock.json
npm install
또는 yarn
을 사용하는 경우:
rm -rf node_modules yarn.lock
yarn install
npm 최신 버전으로 업데이트:
npm install -g npm