Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

461
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda