• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

우분투 서버 빌드 오류

23.06.11 23:29 작성 23.06.11 23:35 수정 조회수 258

0

안녕하세요 제로초님

우분투 서버에서 npm run build를 하는데

처음에는

ModuleNotFoundError: Module not found: Error: Can't resolve 'immer' in '/home/ubuntu/react-nodebird/front/util'

> Build error occurred

Error: > Build failed because of webpack errors

at build (/home/ubuntu/react-nodebird/front/node_modules/next/dist/build/index.js:15:918)

at runMicrotasks (<anonymous>)

at processTicksAndRejections (internal/process/task_queues.js:95:5)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! nodebird@1.0.0 build: cross-env ANALYZE=true NODE_ENV=production next build

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the nodebird@1.0.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

 


이 오류가 떠서 다시 immer 설치 후에 git commit, git push, 우분투 서버에서 git pull을 하였습니다.

 

그 다음에는 굵게 표시한 에러로 바뀌었는데

./util/produce.js

Attempted import error: 'enableES5' is not exported from 'immer'.

> Build error occurred

Error: > Build failed because of webpack errors

at build (/home/ubuntu/react-nodebird/front/node_modules/next/dist/build/index.js:15:918)

at runMicrotasks (<anonymous>)

at processTicksAndRejections (internal/process/task_queues.js:95:5)

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! nodebird@1.0.0 build: cross-env ANALYZE=true NODE_ENV=production next build

npm ERR! Exit status 1

npm ERR!

npm ERR! Failed at the nodebird@1.0.0 build script.

npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

util/produce 파일은 강의에 나온 파일과 똑같습니다!

오류가 왜 나는지 어떻게 해결해야 할지 모르겠어서 질문 남깁니다.. 감사합니다!

immer 버전은 "immer": "^9.0.21", 입니다!!

 

답변 1

답변을 작성해보세요.

0

강의의 immer 버전과 똑같이 하셔야 합니다.