[Open SSL 버전 오류] Error: error:0308010C:digital envelope

DevNoteKeeper·2023년 4월 18일
2

개발 오류 관리

목록 보기
1/3

강의 : Udemy ChatGPT를 이용한 완벽 풀 스택 JavaScript 웹개발

Section 8 - 33강에서 router를 사용한 페이지 이동 진행 중 Error: error:0308010C:digital envelope routines라는 오류가 발생하였습니다. 해당 강의가 ChatCPT를 통해 진행하는 것이다 보니 처음 오류 발생 후 해당 오류에 대한 해결방법에 대해 질문하였습니다.

그에 대한 답변은 아래와 같이 받았습니다.

This error message appears to be related to an unsupported cryptographic algorithm. It's likely that the version of OpenSSL being used by your application is too old to support the algorithm used by the webpack module.

To resolve this issue, you can try upgrading your OpenSSL version. You can also try downgrading the webpack module to an earlier version, or changing the cryptographic algorithm used by the module to one that is supported by your version of OpenSSL.

해당 답변을 토대로 webpack 다운그레이드를 시도하였지만, 제대로 다운그레이드가 실행되지 않으며 동일 문제가 발생하여 다시 오류코드와 함께 질문하였습니다.

그리고 이전과는 다른 해결방법을 받았습니다.

이 오류는 OpenSSL 버전이 업그레이드되어 지원되지 않는 암호화 기능이 있는 경우 발생할 수 있습니다. 다른 사람들이 이와 같은 오류를 겪었을 때 해결 방법 중 하나는 Node.js 버전을 낮추는 것입니다. Node.js v18.15.0에서도 발생하고 있으므로, Node.js v14.x 또는 v16.x 버전으로 다운그레이드하시는 것을 권장합니다.
또 다른 가능한 해결 방법은 webpack과 관련된 종속성을 업그레이드 또는 다운그레이드하는 것입니다. webpack이 사용하는 종속성 중 하나인 create-hash 패키지의 버전을 변경하여 이 오류를 해결할 수도 있습니다. npm ls create-hash 명령을 사용하여 프로젝트에서 사용 중인 버전을 확인한 다음, 적절한 버전으로 업그레이드 또는 다운그레이드하십시오.
그리고 해당 오류가 발생하는 이유를 파악하기 위해 프로젝트의 패키지 의존성 및 설정 파일을 검토하는 것도 도움이 될 수 있습니다.

위 답변을 토대로 Node 버전을 낮추거나, create-hash 패키지 버전을 변경하는 방법을 사용해보았지만 동일 문제가 다시 발생하였습니다. 이번엔 질문 내용을 조금 바꿔 다시 질문하였습니다. 질문 내용에는 현재 제가 해당 오류를 고치기 위해 어떠한 방법들을 사용했는지 알려주고, 오류코드와 함께 어떻게 해결할 수 있는지 질문하였습니다.

이번 질문을 통해 얻은 답변으로 해당 오류를 해결할 수 있었습니다.

  1. Clear your npm cache by running the following command:
npm cache clean --force​
  1. Delete the node_modules folder and package-lock.json file.
  2. Install the npm-check-updates package globally by running the following command:
npm install -g npm-check-updates​
  1. Use npm-check-updates to update your package.json file with the latest versions of your dependencies by running the following command:
ncu -u​
  1. Install the updated dependencies by running the following command:
npm install​
  1. If the issue persists, you can try to install a different version of OpenSSL. You can use the following command to install OpenSSL version 1.1.1:
npm install openssl@1.1.1​

Then, set the OPENSSL_CONF environment variable to point to the openssl.cnf file by running the following command:

export OPENSSL_CONF=/path/to/openssl.cnf
  1. If none of the above steps work, you can try to reinstall Node.js and NPM to ensure that you have a clean installation.
profile
강의에서 주로 질문하는 내용에 대한 답변과 각종 오류 해결방법에 대해 알려드립니다.

0개의 댓글