Working on my dev environment on MacOs.
I'm meeting the following error
Error: /usr/src/app/node_modules/bcrypt/lib/binding/napi-v3/bcrypt_lib.node: invalid ELF header
when I run:
docker-compose up
I have been looking for all similar answers but none really helped me.
Here are the different files that could interest you:
.dockerignore
node_modules
npm-debug.log
coverage
.prettierrc
nodemon.json
.git
.gitignore
LICENSE
VERSION
README.md
Changelog.md
docker-compose.yml
upload
to_reboot
docker-compose.yml
version: '3.8'
services:
    db:
        image: mongo
        volumes:
            - ./backend:/data/db
            - /usr/src/app/node_modules
    dev:
        container_name: nestjs_api_dev
        image: nestjs-api-dev:1.0.0
        build:
            context: .
            target: development
            dockerfile: ./Dockerfile
        command: npm run start:debug
        depends_on:
            - db
        ports:
            - 8000:8000
            - 9229:9229
        volumes:
            - .:/usr/src/app
        restart: unless-stopped
        environment:
            - MONGO_URI=${MONGO_URI}
            - SECRET_KEY=${SECRET_KEY}
> Dockerfile
    FROM node:16 AS development
    
    WORKDIR /usr/src/app
    
    COPY package*.json ./
    
    RUN npm install glob rimraf
    
    RUN npm install
    
    COPY . .
    
    RUN npm run build
If someone could be able to help me solve the issue as well as explaining the answer so I can understand and make sure it never happens again, I'd be glad.