speck-backend | speck-backend | > express-api-starter-ts@1.2.0 dev /app speck-backend | > nodemon src/index.ts "--inspect" speck-backend | speck-backend | node:internal/modules/cjs/loader:1228 speck-backend | throw err; speck-backend | ^ speck-backend | speck-backend | Error: Cannot find module '/app/node_modules/nodemon/bin/nodemon.js' speck-backend | at Module._resolveFilename (node:internal/modules/cjs/loader:1225:15) speck-backend | at Module._load (node:int

This was the error


services:
  frontend:
    container_name: speck-frontend
    image: frontend
    build:
      context: ./speck-frontend
      dockerfile: frontend.dockerfile
      target: dev
    command: pnpm dev
    ports:
      - 3000:3000
    volumes:
       - ./speck-frontend:/app
       - /app/node_modules
       - /app/.next
      #  - ./speck-frontend/.next/cache/webpack:/app/.next/cache/webpack  
    # environment:
    #   - ./speck-frontend/.env
    environment:
      - NODE_ENV=development 
      - NEXT_PUBLIC_SERVER_API=http://backend:4000
      - REDIS_URL=redis://redis:6379
    depends_on:
      - backend

  backend:
    depends_on:
      db:
        condition: service_healthy
    container_name: speck-backend
    image: backend
    build:
      context: ./speck-backend
      dockerfile: backend.dockerfile
    ports:
      - 4000:4000
      - 5555:5555
    environment: 
      - DATABASE_URL=postgresql://postgres:postgres@db:5432/postgres?schema=public
    # env_file:
    #   - .env
    volumes:
      - ./speck-backend:/app
    #   - ./.env:/app/.env

  redis:
    image: redis:alpine
    ports:
      - "6379:6379"

  db:
      container_name: speck-db
      image: postgres:12
      restart: always
      env_file:
        - ./speck-backend/.env
      ports:
        - 5432:5432
      volumes:
        - pgdata:/var/lib/postgresql/data
      healthcheck:
        test: ["CMD-SHELL", "pg_isready -U postgres"]
        interval: 5s
        timeout: 5s
        retries: 5
volumes:
  pgdata: {}

i am using this docker compose file.

and this backend.docker file
FROM node:20

# Install pnpm
RUN npm install -g pnpm

WORKDIR /app

COPY package*.json ./

RUN pnpm install

COPY prisma ./prisma

RUN npx prisma generate

COPY . .

EXPOSE 4000
EXPOSE 5555

CMD ["pnpm", "run", "dev", "--inspect"]

package.json file

{
  "name": "express-api-starter-ts",
  "version": "1.2.0",
  "description": " A basic starter for an express.js API with Typescript",
  "main": "src/index.ts",
  "scripts": {
    "preinstall": "npx only-allow pnpm",
    "start": "ts-node src/index.ts",
    "dev": "nodemon src/index.ts",
    "build": "tsc",
    "start:dist": "node dist/src/index.js",
    "lint": "eslint --fix src test",
    "test": "jest",
    "typecheck": "tsc --noEmit",
    "seed": "ts-node prisma/seed.ts"
  },
  "keywords": [],
  "author": "CJ R. <<PRESIDIO_ANONYMIZED_EMAIL_ADDRESS>> (https://w3cj.now.sh)",
  "repository": {
    "type": "git",
    "url": "https://github.com/w3cj/express-api-starter.git"
  },
  "license": "MIT",
  "dependencies": {
    "@langchain/core": "^0.2.15",
    "@langchain/groq": "^0.0.13",
    "@langchain/openai": "^0.2.2",
    "@prisma/client": "^5.16.2",
    "@types/cheerio": "^0.22.35",
    "@types/express-session": "^1.18.0",
    "axios": "^1.7.2",
    "cheerio": "^1.0.0",
    "cors": "^2.8.5",
    "dotenv": "^16.4.5",
    "express": "^4.19.2",
    "express-session": "^1.18.0",
    "groq-sdk": "^0.5.0",
    "helmet": "^7.1.0",
    "ioredis": "^5.4.1",
    "jsonwebtoken": "^9.0.2",
    "langchain": "^0.2.11",
    "morgan": "^1.10.0",
    "openai": "^4.52.4",
    "passport": "^0.7.0",
    "passport-google-oauth20": "^2.0.0",
    "passport-jwt": "^4.0.1",
    "prisma": "^5.16.2",
    "redis": "^4.7.0",
    "xml2js": "^0.6.2",
    "zod": "^3.23.8"
  },
  "devDependencies": {
    "@types/cors": "^2.8.17",
    "@types/express": "^4.17.21",
    "@types/jest": "^29.5.12",
    "@types/jsonwebtoken": "^9.0.6",
    "@types/morgan": "^1.9.9",
    "@types/node": "^20.14.9",
    "@types/passport": "^1.0.16",
    "@types/passport-google-oauth20": "^2.0.16",
    "@types/supertest": "^6.0.2",
    "@types/xml2js": "^0.4.14",
    "@typescript-eslint/eslint-plugin": "^7.15.0",
    "@typescript-eslint/parser": "^7.15.0",
    "eslint": "^8.57.0",
    "eslint-config-airbnb-typescript": "^18.0.0",
    "eslint-import-resolver-typescript": "^3.6.1",
    "eslint-plugin-import": "^2.29.1",
    "jest": "^29.7.0",
    "nodemon": "^3.1.4",
    "supertest": "^6.3.4",
    "ts-jest": "^29.1.5",
    "ts-node": "^10.9.2",
    "typescript": "^5.5.3"
  }
}

this is my setup, when I run this project, I am getting this error, what should be problem over here?


this error i am only facing in my windows laptop my friend who is using mac doesn't face this