https://cocoon1787.tistory.com/852
[React] "Error: error:0308010C:digital envelope routines::unsupported" 에러 해결
🚀 Error log Error: error:0308010C:digital envelope routines::unsupported ... { opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], library: 'digital envelope routines', reason: 'unsupported', code: 'ERR_OSSL_EVP_UNSU
cocoon1787.tistory.com
도움을 받은 티스토리
If you would prefer to ignore this check, add SKIP_PREFLIGHT_CHECK=true to an .env file in your project. That will permanently disable this message but you might encounter other issues.
리액트 프로젝트 npm start 하면 계속 처음부터 오류가 뜬 것이다.
해결하기 위해서 진짜 구글을 다 뒤졌는데, 일단 순서대로 해보라는 의견이 있어서 해석해가면서 순서대로 해봤다.
.env 파일 만들어서 내용도 적어보고.. 근데 실패
결국 문제는 node.js 버전의 문제였다.
최신버전이 설치되어있어서 삭제하고 LTS버전으로 설치
1. node 완전 삭제
sudo rm -rf /usr/local/lib/node
sudo rm -rf /usr/local/lib/node_modules
sudo rm /usr/local/lib/dtrace/node.d
sudo rm /usr/local/share/man/man1/node.1
sudo rm -rf /usr/local/share/doc/node
sudo rm -rf /usr/local/share/systemtap/tapset/node.stp
sudo rm -rf /usr/local/include/node
sudo rm /usr/local/bin/node
sudo rm /usr/local/bin/npm
sudo rm /usr/local/bin/npx
2. 버전에 맞는 node설치
3. 설치 확인
node -v
npm -v
여기까지 한 다음 다시 npm start하니까 다른 오류가 발생했다.
error:0308010c:digital envelope routines::unsupported
흠.. 이런저런 방법을 찾던 중 티스토리 발견하고 따라 해보는데
나도 react-script 버전 문제였다. 4.0 버전으로 설치되어있었는데, 최소 5 이상의 버전을 추천한다고 하더라
4. react-script 5.0.1 버전 설치하기
npm install --save react-scripts@5.0.1
성공했다.. 휴 ..
'FE·Client > React' 카테고리의 다른 글
[React] Portals, Ref, uncontrolled component (0) | 2023.01.11 |
---|---|
[React] 리액트 컴포넌트 스타일링, styled-components, 미디어쿼리, CSS 모듈 (0) | 2023.01.09 |
[React] 동적 배열 할당, 조건부 렌더링 (1) | 2023.01.06 |
[React] props.childern, State, 상향식 컴포넌트 통신(자식컴포넌트에서 부모컴포넌트로 데이터 넘기기), 상태 끌어올리기(Lifting State Up) (0) | 2023.01.04 |
[React] React 초기 설정, JSX, toISOString, props, toLocalString() (1) | 2022.12.27 |