Notice
Recent Posts
Recent Comments
Link
«   2026/04   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
Today
Total
관리 메뉴

MGIT

[Vue.js] npm run build (Entry module not found: Error:) 본문

프론트 기록/Vue.js

[Vue.js] npm run build (Entry module not found: Error:)

구구99 2023. 11. 15. 11:23

vue.js에서 Front단을

상용 배포용으로 빌드하여 파일을 생성 후 압축하려고 했더니 아래와 같은 오류가 출력되었다.

 

명령어: npm run build

 ERROR  Failed to compile with 1 error                                                                                                                      오전 10:38:02

 error 

Entry module not found: Error: Can't resolve 'C:\user\Documents\ZeroMG\backend;tar' in 'C:\user\Documents\ZeroMG\front'

 ERROR  Build failed with errors.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! xcost-adm-front@1.0.0 build: `vue-cli-service build --mode production;cd ../backend;tar cvf public.tar public`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the xcost-adm-front@1.0.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 run build'를 입력 하자마자 위와같이 오류가 출력되어

정보를 찾아보던 중 'package.json'에 내가 설정한 명령어가 제대로 실행되지 않아서 였다.

 

'package.json'에 보면 

[ 변경 전 ]

이런 부분이 있을 것이다.

여기서 난 serve(개발모드 명령)가 아닌 build(상용모드 명령)를 사용해서 위와같은 부분이 순차 실행되는데

명령어가 실행이 제대로 안된것이였다.

 

원인은 간단하다.

문단을 나눠주는 ' ; ' 구분 기호가 제대로 안먹어서 그렇다.

원래 세미콜론(;)으로도 되었던것 같은데 버전이 달라서 그런가

되지않아서 해당 구분기호를 (&&)로 변경해 주었다.

 

[ 변경 후 ]

 

적어둔 명령어들이 잘 실행된것을 확인 할 수 있을 것이다.

 

+ 추가

터미널(terminal)을 powerShell같은 걸 사용하면 오류가 날 수 있다.

웬만하면 GitBashCMD를 활용하여 명령어를 사용하는게 올바른 방법이다.