일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- 웹 SW
- ECS
- mysql
- DevOps
- docker
- 백준
- dfs
- 프로세스
- 설치형 SW
- comdef
- 출력 명령어
- SSAFY입학
- zshrc error
- OpenSearch
- 코드스테이츠
- 홈 디렉토리
- 수직확장
- MongoServerSelectionError
- 부트캠프
- 지속적 전달
- fastify-cli
- Java 입력
- cli
- c++
- neofetch
- fastify
- 리눅스
- char 입력
- docker context create
- ci/cd
Archives
- Today
- Total
다디와 괴발개발
[M1 Mac, AWS Lambda] 'sharp' cannot find module, Something went wrong installing the \"sharp\" 오류 해결 본문
TroubleShooting
[M1 Mac, AWS Lambda] 'sharp' cannot find module, Something went wrong installing the \"sharp\" 오류 해결
아임다디 2022. 4. 26. 21:40발생시기
이미지를 resize하는 AWS Lambda 함수를 만들기 위해 작업하는 도중 발생한 에러
상황
npm의 sharp
모듈을 사용해야 하는데, 모듈을 사용하려고 하면 'sharp' cannot find module
이나, Something went wrong installing the \"sharp\"
에러가 출력되는 상황
원인
M1 Mac 문제인 것으로 확인되며, package.json
의 depencencies
에서 sharp
가 있으면 해당 에러를 뱉는다.
해결
package.json
의 dependencies
에서 sharp
관련 라인을 삭제해준다
{
"dependencies": {
"aws-sdk": "^2.1111.0"
"sharp": "^0.30.3" // 해당 라인을 삭제해준다
},
"devDependencies": {
"jest": "^26.6.3"
},
"scripts": {
"test": "jest",
"preinstall": "npm install --platform=linux --arch=x64 --no-save sharp"
}
}
결론
우리 m1이는 왜이렇게 까다로울까. 구글링 할 때도 mac이나 m1을 붙여서 검색하면 좀 더 수월하게 검색할 수 있을 것 같다.