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

850
Views
Extraño error next.js en producción: ENOENT: No existe tal archivo o directorio (caché de imagen)

Tengo problemas con mi implementación de next.js en AWS EC2. npm run build y luego npm run start , y funciona bien. En ese momento, no hay imágenes webp en el caché, como se esperaba. Luego cargo la página web desde mi navegador y funciona bien. Sin embargo, parece fallar al azar cuando cargo la página a veces. Y me sale el error de arriba. Parece que la imagen webp se está eliminando del caché en algún momento y está causando un error. ¿Alguna sugerencia?

El error completo es:

 Error: ENOENT: no such file or directory, open '/home/ec2-user/prowash/pro-wash-site/.next/cache/images/7P-NdCEO6XWRTvqPItIV6CN1db-7IkBJw9kp3M5VafQ=/0.1647390677641.UEF7UxgKHha+us8b5ahYFWZH70qZHTAu2uyVPlYT7Hs=.webp' Emitted 'error' event on ReadStream instance at: at emitErrorNT (node:internal/streams/destroy:164:8) at emitErrorCloseNT (node:internal/streams/destroy:129:3) at processTicksAndRejections (node:internal/process/task_queues:83:21) { errno: -2, code: 'ENOENT', syscall: 'open', path: '/home/ec2-user/prowash/pro-wash-site/.next/cache/images/7P-NdCEO6XWRTvqPItIV6CN1db-7IkBJw9kp3M5VafQ=/0.1647390677641.UEF7UxgKHha+us8b5ahYFWZH70qZHTAu2uyVPlYT7Hs=.webp' }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Tal vez use un script de compilación para establecer los permisos y luego implementar la siguiente compilación.

Modificando la solución para EBS a través de este artículo :

  1. Un script Build.sh que establece permisos antes de su implementación
 #!/bin/bash # Exit immediately if a command exits with a non-zero status set -e # building the Next.js application npm run next:build # creating the build/cache/images folder and give it # the read/write permissions mkdir -p .next/cache/images chmod -R 666 .next/cache/images
  1. Adición a package.json para asegurarse de que se ejecuta en npm run build
 "scripts": { "build": "./build.sh" }
about 4 years ago · Juan Pablo Isaza 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!