
netlify로 배포하려고 하는데 계속 안됨.
build 명령어를 CI=를 붙여서 해보래서 붙여서 yarn build, npm run build, react-scripts build 별 걸 다 해봤는데 안된다.
ENOENT: no such file or directory, open '/opt/build/repo/package.json'
Our site builds in development, but fails in production. The error seems to be here: ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’ Not sure why production is failing to build. Can you help? Netlify site name: goodhere.netlify.a
answers.netlify.com
설정을 잘못한거였음.

내가 git 레포에는 front 폴더와 back 폴더가 같이 있는 폴더를 통째로 올렸는데,
당연히 여기선 front 폴더만 배포하는 것이므로(package.json이 있는 폴더)
Base directory를 front로 해야하고,
publish directory는 index.html이 있는 build 폴더까지로 설정해야한다. (build 명령어를 한 번 쳐보면 index.html의 경로가 build 폴더인지 public 폴더인지 알 수 있음.)
그리고 Build command에 CI= 저거 안붙이면 사용 안하는 변수들 있다고 하나하나 지적해주니 꼭 붙여주자.
근데 저걸 안붙이면 배포가 안되는지는 모르겠음.
또 내가 yarn도 해보고 npm도 쓰고 막 섞어쓰니까 섞어쓰지말라고 뭐라 나온 것 같은데 그냥 되기만 하면 되는거지 뭐... ㅎ
'Front' 카테고리의 다른 글
| justify-content가 적용이 안될 때 (0) | 2021.04.18 |
|---|---|
| [CSS] html, css, js로 포트폴리오 클론코딩을 해보았다. (0) | 2021.02.04 |
| [CSS] Grid layout 공부 (0) | 2021.01.30 |