복잡한뇌구조마냥

node:internal/crypto/hash:71 오류 해결 본문

웹 개발 공부

node:internal/crypto/hash:71 오류 해결

지금해냥 2023. 2. 14. 16:56

기존에 세팅되어있는 개발환경보다 버전이 낮은 개발환경의 코드를 불러와서 작업하게 되었음.

 

angular 버전은 재 설치를 하였으나 node 재설치 없이 이전 버전의 node 데이터를 이용하여 동작되기를 원함

 

 

node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

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 (C:\Users\aswal\code\main\node_modules\webpack\lib\util\createHash.js:135:53)
    at NormalModule._initBuildHash (C:\Users\aswal\code\main\node_modules\webpack\lib\NormalModule.js:417:16)
    at C:\Users\aswal\code\main\node_modules\webpack\lib\NormalModule.js:452:10
    at C:\Users\aswal\code\main\node_modules\webpack\lib\NormalModule.js:323:13
    at C:\Users\aswal\code\main\node_modules\loader-runner\lib\LoaderRunner.js:367:11
    at C:\Users\aswal\code\main\node_modules\loader-runner\lib\LoaderRunner.js:203:19
    at VirtualFileSystemDecorator.readFile (C:\Users\aswal\code\main\node_modules\@ngtools\webpack\src\virtual_file_system_decorator.js:46:13)
    at processResource (C:\Users\aswal\code\main\node_modules\loader-runner\lib\LoaderRunner.js:202:11)
    at iteratePitchingLoaders (C:\Users\aswal\code\main\node_modules\loader-runner\lib\LoaderRunner.js:158:10)
    at runLoaders (C:\Users\aswal\code\main\node_modules\loader-runner\lib\LoaderRunner.js:365:2)
    at NormalModule.doBuild (C:\Users\aswal\code\main\node_modules\webpack\lib\NormalModule.js:295:3)
    at NormalModule.build (C:\Users\aswal\code\main\node_modules\webpack\lib\NormalModule.js:446:15)
    at Compilation.buildModule (C:\Users\aswal\code\main\node_modules\webpack\lib\Compilation.js:739:10)
    at C:\Users\aswal\code\main\node_modules\webpack\lib\Compilation.js:981:14 {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Node.js v18.12.1

angular 구동시 다음과 같은에러 발생

 

조치방법은 매우 간단했다.

 

$ export NODE_OPTIONS=--openssl-legacy-provider

다음 명령어를 치고 angular를 실행했더니 정상적으로 작동됨.

 

노드의 옵션을 제공하는 버전에 맞춰서 동작하도록 해주는 명령어로 알고있는데 작업에 유용하게 사용중이다.

 

간단한 오류해결은 간혹 지금처럼 단순하게 정리하여 올릴 예정입니다.

LIST