• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    해결됨

AWS에서 "sharp" module 설치 에러

19.09.09 01:14 작성 조회수 1.89k

0

제로초님, 안녕하세요.

AWS에서 람다를 등록하였는데, 람다 호출 시 에러가 발생합니다.

우선, 웹사이트에서 S3에 original/ 폴더에는 이미지가 업로드 됩니다.

그러나, 람다가 호출은 되지만 에러가 발생하여 thumb/ 폴더는 생성되지 않습니다.

AWS 백엔드 서버에서 아래와 같이 조치하여도 해결이 되지 않네요.

-----------------------------------------------------

# rm -r node_modules/sharp

# sudo npm i

-----------------------------------------------------

> sharp@0.23.0 install /home/ubuntu/dream-life/lambda/node_modules/sharp

> (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

 

info sharp Using cached /root/.npm/_libvips/libvips-8.8.1-linux-x64.tar.gz

npm WARN dream-life-lambda@1.0.0 No description

npm WARN dream-life-lambda@1.0.0 No repository field.

 

added 1 package from 57 contributors and audited 181 packages in 1.806s

found 0 vulnerabilities

-----------------------------------------------------

[AWS CloudWatch 로그]

-----------------------------------------------------

2019-09-08T15:59:10.694Z undefined ERROR
Something went wrong installing the "sharp" module

Module did not self-register.

- Remove the "node_modules/sharp" directory, run "npm install" and look for errors
- Consult the installation documentation at https://sharp.pixelplumbing.com/en/stable/install/
- Search for this error at https://github.com/lovell/sharp/issues

-----------------------------------------------------

어떻게 해결할 수 있을까요? ㅠㅠ

답변 3

·

답변을 작성해보세요.

1

해결했습니다! claudia 에서 sharp 설치가 안 되는 문제의 원인은 Node 버전을 10(LTS)으로 세팅해야 하는데, 제가 최신 버전인 12 버전으로 설치해서 였던 것 같습니다.

Node를 10.16.3으로 설정하고 update하니 설치가 되었습니다. 도움을 주셔서 감사합니다.

1

저처럼 claudia를 통해서 배포하셨나요? 그렇다면 재설치 후 sudo claudia update도 하셔야 합니다.

0

libertines11님의 프로필

libertines11

2020.05.06

이걸로 2일동안 S3 지웠다가 설치하고 람다 다시 세팅하고 했었는데.... 

진작에 이글을 봤었으면 금방해결되었을것을... 

저는 한참을 삽질했네요..ㅠ.ㅠ

만약 해매시는 분들을 위해 링크도 남깁니다 (체크할)

https://github.com/lovell/sharp/issues/2169

https://sharp.pixelplumbing.com/install

그리고 GIF 파일은 sharp에서 변환 지원이 안되네요..^^;;