환경
docker
nest
mac os
문제상황
bcrypt가 안돼요
해결하기
1. .dockerignore에 node_modules 설정
안된다.
2. docker compose volume에 /node_modules설정
도커쪽에서 오류가 난다. 조금 더 손보면 될 것 같은데 편안 해결방법을 더 찾아보자.
해결
https://www.npmjs.com/package/bcryptjs
bcryptjs
Optimized bcrypt in plain JavaScript with zero dependencies. Compatible to 'bcrypt'.. Latest version: 2.4.3, last published: 7 years ago. Start using bcryptjs in your project by running `npm i bcryptjs`. There are 3441 other projects in the npm registry us
www.npmjs.com
이걸쓰는게 제일 간단한 해결법이었다.
이유
I've found that bcrypt compiled on OSX will not quite work on Linux. In other words, if you check in the bcrypt compiled on your local OSX workstation, and try to run the node app on your linux servers, you will see the error above.
Only problem is: bcrypt, unlike other node modules, only installs a single OS binary. So committing a Linux-installed bcrypt will break your Mac developer systems,
It is not cross-compiling, rather giving you pre-compiled binaries. Node-gyp does NOT cross-compile by default.
해당 모듈은 크로스컴파일을 하지 않고 미리 컴파일된 바이너리를 제공하지 않아 OS가 맞지 않으면 오류가 난다고한다.
'개발' 카테고리의 다른 글
github oauth2 클라이언트와 서버 구현해보기 -3 (1) | 2024.02.15 |
---|---|
github oauth2 클라이언트와 서버 구현해보기 -2 (1) | 2024.02.15 |
github oauth2 클라이언트와 서버 구현해보기 -1 (0) | 2024.02.12 |
react-hook-form을 이용한 복잡한 폼 구현 feat checkbox (1) | 2024.01.11 |
프로젝트에서 예상치 못한 곳에서 발생하는 리다이렉트를 막은 방법 (0) | 2024.01.08 |