Newbie Trying to deploy my site to Netlify

PLEASE help us help you by writing a good post!

I am trying to deploy to netlify app. I keep getting this error meassage after delpoy failed. What am I doing wrong?

4:32:22 PM: Build ready to start
4:32:23 PM: build-image version: b0258b965567defc4a2d7e2f2dec2e00c8f73ad6
4:32:23 PM: build-image tag: v3.4.1
4:32:23 PM: buildbot version: c6376102eedf4be6c6e5d685c7141e2eb612d47d
4:32:23 PM: Fetching cached dependencies
4:32:24 PM: Failed to fetch cache, continuing with build
4:32:24 PM: Starting to prepare the repo for build
4:32:24 PM: No cached dependencies found. Cloning fresh repo
4:32:24 PM: git clone https://github.com/dreamchild7/overwood-group4
4:32:24 PM: Preparing Git Reference refs/heads/main
4:32:26 PM: Starting build script
4:32:26 PM: Installing dependencies
4:32:26 PM: Python version set to 2.7
4:32:27 PM: v12.18.0 is already installed.
4:32:27 PM: Now using node v12.18.0 (npm v6.14.4)
4:32:27 PM: Started restoring cached build plugins
4:32:27 PM: Finished restoring cached build plugins
4:32:28 PM: Attempting ruby version 2.7.1, read from environment
4:32:29 PM: Using ruby version 2.7.1
4:32:29 PM: Using PHP version 5.6
4:32:29 PM: 5.2 is already installed.
4:32:29 PM: Using Swift version 5.2
4:32:29 PM: Started restoring cached go cache
4:32:29 PM: Finished restoring cached go cache
4:32:29 PM: go version go1.14.4 linux/amd64
4:32:29 PM: go version go1.14.4 linux/amd64
4:32:29 PM: Installing missing commands
4:32:29 PM: Verify run directory
4:32:30 PM: ​
4:32:30 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
4:32:30 PM: β”‚ Netlify Build β”‚
4:32:30 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
4:32:30 PM: ​
4:32:30 PM: ❯ Version
4:32:30 PM: @netlify/build 4.8.1
4:32:30 PM: ​
4:32:30 PM: ❯ Flags
4:32:30 PM: deployId: 5f7c8e06debb7d01403e92c8
4:32:30 PM: mode: buildbot
4:32:30 PM: ​
4:32:30 PM: ❯ Current directory
4:32:30 PM: /opt/build/repo
4:32:30 PM: ​
4:32:30 PM: ❯ Config file
4:32:30 PM: No config file was defined: using default values.
4:32:30 PM: ​
4:32:30 PM: ❯ Context
4:32:30 PM: production
4:32:30 PM: ​
4:32:30 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
4:32:30 PM: β”‚ 1. Build command from Netlify app β”‚
4:32:30 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
4:32:30 PM: ​
4:32:30 PM: $ npm run build
4:32:30 PM: npm ERR! code ENOENT
4:32:30 PM: npm ERR! syscall open
4:32:30 PM: npm ERR! path /opt/build/repo/package.json
4:32:30 PM: npm ERR! errno -2
4:32:30 PM: npm ERR! enoent ENOENT: no such file or directory, open β€˜/opt/build/repo/package.json’
4:32:30 PM: npm ERR! enoent This is related to npm not being able to find a file.
4:32:30 PM: npm ERR! enoent
4:32:30 PM: npm ERR! A complete log of this run can be found in:
4:32:30 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-10-06T15_32_30_952Z-debug.log
4:32:30 PM: ​
4:32:30 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
4:32:30 PM: β”‚ β€œbuild.command” failed β”‚
4:32:30 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
4:32:30 PM: ​
4:32:30 PM: Error message
4:32:30 PM: Command failed with exit code 254: npm run build
4:32:30 PM: ​
4:32:30 PM: Error location
4:32:30 PM: In Build command from Netlify app:
4:32:30 PM: npm run build
4:32:30 PM: ​
4:32:30 PM: Resolved config
4:32:30 PM: build:
4:32:30 PM: command: npm run build
4:32:30 PM: commandOrigin: ui
4:32:30 PM: publish: /opt/build/repo/dist
4:32:31 PM: Caching artifacts
4:32:31 PM: Started saving build plugins
4:32:31 PM: Finished saving build plugins
4:32:31 PM: Started saving pip cache
4:32:31 PM: Finished saving pip cache
4:32:31 PM: Started saving emacs cask dependencies
4:32:31 PM: Finished saving emacs cask dependencies
4:32:31 PM: Started saving maven dependencies
4:32:31 PM: Finished saving maven dependencies
4:32:31 PM: Started saving boot dependencies
4:32:31 PM: Finished saving boot dependencies
4:32:31 PM: Started saving go dependencies
4:32:31 PM: Finished saving go dependencies
4:32:33 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 2
4:32:33 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:32:33 PM: Failing build: Failed to build site
4:32:34 PM: Finished processing build request in 10.729448009s

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

That part shows the error pretty well.

Specifically this:

To simplify further, I checked your repo and all you have is a index.html file and a CSS folder. No package.json or nothing to build. From the looks of it, it looks like the website is already built. You just need to deploy it and not rebuild the website. You would want to remove all build commands from your Netlify dashboard.

1 Like