react 배포 에러

BackEnd_Ash.log·2020년 6월 12일
0

react

목록 보기
11/41

리액트 에서 배포할려고하는데
yarn build
혹은
sudo npm run build
가 되지 않는다 .

이유가 무엇일까 ?

Cannot find module: 'react-router-dom'. Make sure this package is installed.

You can install this package by running: yarn add react-router-dom.


npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! 이름@0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the 이름@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/이름/.npm/_logs/2020-06-12T04_13_09_193Z-debug.log

이러한 에러가 발생하게 된다.
이유가 무엇일까 ??

원래는 이런식으로 화면이 나와야하는데
에러가 잔뜩 나오게 된다 .

다시 git clone 으로 주소를 받고
주소로 들어가서
npm install 설치를 해준다.
npm run build 했을때 에러가 발생하게 된다면
만약에 패키지 설치로 인한 에러이면
npm 으로 패키지를 설치해준다.

그리고 다시 sudo npm run build
하니깐 이제 접속은 된다.

그러나 !!

흰화면이 나온다 .

혹은

그다음으로 넘어가지 않았다..

왜 그러는걸가 ??

개발자 도구를 확인해보면 그래도 전혀 빈페이지로 아무것도 안받는것이 아니였다 .
그중에서 내가 style 작성한거 몇개는 받아온것이 보인다.

그래서 다시한번 지우고 설치해보기로 한다.

똑같았다..이때 부터 슬슬 욕이 나오기 시작했다.

버전 업데이트

https://blog.stories.pe.kr/271
버전업데이트를 하고 나서 다시 해보면 해결 된것을 볼 수 있다.

npm install -g npm-check-updates
ncu -u 
npm install

버전 업데이트를 시키고 나서 ,
다시 한번 sudo node server.js
실행을 해보면 잘 동작하는것을 볼 수 있다 .

profile
꾸준함이란 ... ?

2개의 댓글

comment-user-thumbnail
2021년 2월 24일

2시간을 헤맸는데 덕분에 잘 해결하고 갑니다 감사합니다 ~

1개의 답글