Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.8K
Views
Docker - /bin/sh: nodemon: no encontrado

Tengo el siguiente archivo docker.

 #Dockerfile FROM node:alpine WORKDIR /backend COPY package*.json . RUN yarn COPY . . EXPOSE 5000 CMD ["yarn", "dev"]

Nodemon funciona según lo previsto en la máquina host, pero muestra el siguiente mensaje de error al ejecutar el contenedor.

 yarn run v1.22.5 $ nodemon /bin/sh: nodemon: not found error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Nodemon no está instalado globalmente en la máquina host. Agregar RUN yarn add global nodemon en Dockerfile solo agrega una warning ../package.json: No license field en el error del contenedor.

Actualmente tengo el siguiente archivo package.json con las siguientes dependencias de desarrollo

 # package.json ... "scripts": { "build": "tsc -p .", "start": "node ./dist/src/index.js", "dev": "nodemon", "test": "echo \"Error: no test specified\" && exit 1" }, "devDependencies": { "@types/express": "^4.17.11", "@types/node": "^14.14.34", "nodemon": "^2.0.7", "ts-node": "^9.1.1", "typescript": "^4.2.3" }, ...

y nodemon.json como

 { "watch": [ "src" ], "ext": "ts,json", "ignore": [ "src/**/*.spec.ts" ], "exec": "yarn ts-node src/index.ts" }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Prueba con abajo,

 #Dockerfile FROM node:alpine WORKDIR /backend COPY package*.json . RUN yarn RUN yarn add global nodemon COPY . . EXPOSE 5000 CMD ["yarn", "dev"]

NOTA AL MARGEN: Es mejor que no nodemon en producción. Sirva los archivos de compilación como en su secuencia de comandos de start . Debe agregar el comando de compilación antes de que comience el hilo.

 #Dockerfile FROM node:alpine WORKDIR /backend COPY package*.json . RUN yarn COPY . . RUN yarn run build EXPOSE 5000 CMD ["yarn", "start"]
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!