• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

ec2 npm install sharp error

22.09.27 20:05 작성 조회수 621

0

스크린샷 2022-09-27 오후 8.04.20.png

ec2 ssh 접속하여 npm install을 하였는데 sharp 모듈이 설치가 안 되는 것 같습니다. node version도 요구 사항을 충족해주었는데 무엇이 문제인지 해결하지 못하고 있습니다.

답변 1

답변을 작성해보세요.

0

신재우님의 프로필

신재우

질문자

2022.09.27

https://sharp.pixelplumbing.com/install#chinese-mirror

해당 링크를 통해 에러를 해결했습니다!

client/Dockerfile을

FROM node:alpine

ENV PORT 3000

WORKDIR /usr/src/app

COPY package*.json ./

RUN npm config set sharp_binary_host "https://npmmirror.com/mirrors/sharp"

RUN npm config set sharp_libvips_binary_host "https://npmmirror.com/mirrors/sharp-libvips"

RUN npm install

COPY ./ ./

ENV NODE_ENV production

RUN npm run build:prod

CMD ["npm","run","start:prod"]

로 수정하였습니다