Vue netlify build error

iikasam·2022년 12월 9일
post-thumbnail

build.command failed

build command : npm run build 앞에 CI= 를 붙여준다.

해결이 안되는 것 같아 package.json 에도 넣어줬다.

  "scripts": {
    "serve": "vue-cli-service serve",
    "build": "CI= vue-cli-service build",
    "lint": "vue-cli-service lint"
  },


netilify에서 준 가이드라인 참고하여 환경변수 세팅도 했다.

변경사항 push / npm run serve 정상작동 확인

애초에 이 부분부터 잘못된 것일 수도..
노트북-데탑 왔다갔다 하니 체크를 못했다 (빌드할 생각에)

Deploy failed - Failed during stage 'building site': Build script returned non-zero exit code: 2

base directory 에 빈칸을 두고 세팅했는데 경로를 프로젝트 루트로 설정하지 않아서 오류가 남

Base directory 에 프로젝트 이름을 적었다.

이렇게 세팅하면

Base directory 에 따라 publish directory도 달라진다.

Build configuration overview

https://docs.netlify.com/configure-builds/overview/

profile
묵묵히, 꾸준히,

0개의 댓글