본문 바로가기
Languages

[intellij+windows+vue+bootstrap] npm run build 시 Error: error:0308010C:digital envelope routines::unsupported 발생 해결

by lucidiz 2023. 7. 11.
반응형

IntelliJ, windows 환경에서 vue를 빌드할려고 "npm run build" 명령어를 실행시켰다. 그리고 다음과 같이 오류가 발생하였고 그리고 해결은 다음과 같이 하였습니다.

<오류>

Error: error:0308010C:digital envelope routines::unsupported
Error: error:0308010C:digital envelope routines::unsupported

PS E:\a\frontend> npm run build

> frontend@2.1.0 build
> vue-cli-service build


|  Building for production...Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:133:10)
    at module.exports (E:\a\frontend\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (E:\a\frontend\node_modules\webpack\lib\NormalModule.js:417:16)
    at handleParseError (E:\a\frontend\node_modules\webpack\lib\NormalModule.js:471:10)
    at E:\a\frontend\node_modules\webpack\lib\NormalModule.js:503:5
    at E:\a\frontend\node_modules\webpack\lib\NormalModule.js:358:12
    at E:\a\frontend\node_modules\loader-runner\lib\LoaderRunner.js:373:3
    at iterateNormalLoaders (E:\a\frontend\node_modules\loader-runner\lib\LoaderRunner.js:214:10)
    at iterateNormalLoaders (E:\a\frontend\node_modules\loader-runner\lib\LoaderRunner.js:221:10)
    at E:\a\frontend\node_modules\loader-runner\lib\LoaderRunner.js:236:3
    at runSyncOrAsync (E:\a\frontend\node_modules\loader-runner\lib\LoaderRunner.js:130:11)
    at iterateNormalLoaders (E:\a\frontend\node_modules\loader-runner\lib\LoaderRunner.js:232:2)
    at Array.<anonymous> (E:\a\frontend\node_modules\loader-runner\lib\LoaderRunner.js:205:4)
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

 

<해결방법>

윈도우 PowerShell에서는 다음과 같이 실행한다.

Node.js v18.16.0
PS E:\a\frontend> $env:NODE_OPTIONS = "--openssl-legacy-provider"
PS E:\a\frontend> npm run build

윈도우 터미널에서는 다음과 같이 실행한다.

set NODE_OPTIONS=--openssl-legacy-provider

리눅스에서는 다음과 같이 실행한다.

export NODE_OPTIONS=--openssl-legacy-provider

 

<출처, 참고>

https://stackoverflow.com/questions/69692842/error-message-error0308010cdigital-envelope-routinesunsupported

 

Error message "error:0308010C:digital envelope routines::unsupported"

I created the default IntelliJ IDEA React project and got this: Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHa...

stackoverflow.com

 

반응형