Open darkdiesel opened 2 weeks ago
This usually happens if bcrypt.node is of a different OS/Arch than it was originally installed it
Are you running docker or some remote development environment?
If you are working on Docker, you should ignore node_modules, this will solve your problem. If you are working with docker-compose, you probably mounted your application from the host (your root directory) to the container. This replaced the node_modules on the host with the node_modules inside docker.
docker-compose.yaml example
version: '3.9'
services:
api:
build:
context: .
dockerfile: Dockerfile
target: development
ports:
- "3000:3000"
env_file:
- .env
volumes:
- ./:/app
- /app/node_modules
docker example
docker run -d \
-p 3000:3000 \
--env-file .env \
-v $(pwd):/app \
-v /app/node_modules \
--name api \
your_image_name
This usually happens if bcrypt.node is of a different OS/Arch than it was originally installed it
Are you running docker or some remote development environment?
Yes, using docker and sometimes vagrant with virtual box
If you are working on Docker, you should ignore node_modules, this will solve your problem. If you are working with docker-compose, you probably mounted your application from the host (your root directory) to the container. This replaced the node_modules on the host with the node_modules inside docker.
docker-compose.yaml example
version: '3.9' services: api: build: context: . dockerfile: Dockerfile target: development ports: - "3000:3000" env_file: - .env volumes: - ./:/app - /app/node_modules
docker example
docker run -d \ -p 3000:3000 \ --env-file .env \ -v $(pwd):/app \ -v /app/node_modules \ --name api \ your_image_name
Thanks will try today your solution
Did you solve the problem?
Hello!
Before writing i searching the same issues but anyway not found a solution. :(
Used: "bcrypt": "^5.1.1", "@types/bcrypt": "^5.0.2", "@nestjs/core": "^10.3.10",
Node tested, node 20.17.0 (npm 10.8.2) node 21.7.3 (npm 10.5.0) node 22.5.1 (npm 10.8.3)
I used instruction from https://docs.nestjs.com/security/encryption-and-hashing site, but after starting dev or prod server i have an error:
full package.json