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

460
Views
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 answers
Answer question

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 Report

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 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!