Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

459
Vistas
netlify build failure: npm ERR! path /opt/build/repo/package.json

I have a django 1.10 app which I have deployed to netlify but is failing to build. I'm using the django distill app to generate the static files. and I have pushed these to https://github.com/kc1/static1 .

The netlify build log has;

1:12:57 PM: $ npm run-script build
1:12:57 PM: npm ERR! code ENOENT
1:12:57 PM: npm ERR! syscall open
1:12:57 PM: npm ERR! path /opt/build/repo/package.json
1:12:57 PM: npm ERR! errno -2
1:12:57 PM: npm ERR! enoent ENOENT: no such file or directory, open '/opt/build/repo/package.json'
1:12:57 PM: npm ERR! enoent This is related to npm not being able to find a file.
1:12:57 PM: npm ERR! enoent
1:12:57 PM: npm ERR! A complete log of this run can be found in:
1:12:57 PM: npm ERR!     /opt/buildhome/.npm/_logs/2021-08-05T17_12_57_910Z-debug.log
1:12:57 PM: ​
1:12:57 PM: ────────────────────────────────────────────────────────────────
1:12:57 PM:   "build.command" failed                                        
1:12:57 PM: ────────────────────────────────────────────────────────────────
1:12:57 PM: ​
1:12:57 PM:   Error message

1:12:57 PM: Command failed with exit code 254: npm run-script build

As you can see in the repo I don't have a package.json ( this came from python ). Do I need to create one? How do I get this working?

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Keep build command as blank.

You only have to add the build command when we have to "build" something, since you already generated the static files you don't have to build it again.

about 4 years ago · Juan Pablo Isaza Denunciar

0

The answer by Sumithran helped me step in the right direction.

I previously wrote a blog using gatsby then I switched to hugo.

In Netlify I only changed the repository. I was still using npm run-script build as my build command and that was causing this error.

I initially tried emptying the 'build command' but that caused a different error.

I watched a video on Hugo and Netlify and learned that I just needed to pass on hugo in the build command.

tldr the correct value for your 'build command' depends on the Tools you're using.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda