Home
Support Forums

I cant deploy my site

Please i need help around this. I keep getting this error which isnt building my page

4:41:34 AM: Build ready to start
4:41:36 AM: build-image version: fa439ad1ab9393b2c0d449d8d7c033927683f4b0
4:41:36 AM: build-image tag: v4.3.0
4:41:36 AM: buildbot version: 1ed4041128c7c024b4c4b72e2ad30a0740c570a7
4:41:36 AM: Building without cache
4:41:36 AM: Starting to prepare the repo for build
4:41:37 AM: No cached dependencies found. Cloning fresh repo
4:41:37 AM: git clone https://github.com/Adetutu777/frontend-booking-page
4:41:37 AM: Preparing Git Reference refs/heads/master
4:41:38 AM: Parsing package.json dependencies
4:41:38 AM: Starting build script
4:41:38 AM: Installing dependencies
4:41:38 AM: Python version set to 2.7
4:41:39 AM: Downloading and installing node v16.8.0…
4:41:39 AM: Downloading https://nodejs.org/dist/v16.8.0/node-v16.8.0-linux-x64.tar.xz
4:41:40 AM: Computing checksum with sha256sum
4:41:40 AM: Checksums matched!
4:41:43 AM: Now using node v16.8.0 (npm v7.21.0)
4:41:43 AM: Started restoring cached build plugins
4:41:43 AM: Finished restoring cached build plugins
4:41:43 AM: Attempting ruby version 2.7.2, read from environment
4:41:44 AM: Using ruby version 2.7.2
4:41:45 AM: Using PHP version 8.0
4:41:45 AM: Started restoring cached node modules
4:41:45 AM: Finished restoring cached node modules
4:41:45 AM: Installing NPM modules using NPM version 7.21.0
4:41:46 AM: npm WARN old lockfile
4:41:46 AM: npm WARN old lockfile The package-lock.json file was created with an old version of npm,
4:41:46 AM: npm WARN old lockfile so supplemental metadata must be fetched from the registry.
4:41:46 AM: npm WARN old lockfile
4:41:46 AM: npm WARN old lockfile This is a one-time fix-up, please be patient…
4:41:46 AM: npm WARN old lockfile
4:41:49 AM: added 125 packages, and audited 126 packages in 4s
4:41:49 AM: 17 packages are looking for funding
4:41:49 AM: run npm fund for details
4:41:49 AM: found 0 vulnerabilities
4:41:49 AM: NPM modules installed
4:41:50 AM: Started restoring cached go cache
4:41:50 AM: Finished restoring cached go cache
4:41:50 AM: go version go1.16.5 linux/amd64
4:41:50 AM: go version go1.16.5 linux/amd64
4:41:50 AM: Installing missing commands
4:41:50 AM: Verify run directory
4:41:51 AM: ​
4:41:51 AM: ────────────────────────────────────────────────────────────────
4:41:51 AM: Netlify Build
4:41:51 AM: ────────────────────────────────────────────────────────────────
4:41:51 AM: ​
4:41:51 AM: ❯ Version
4:41:51 AM: @netlify/build 18.7.3
4:41:51 AM: ​
4:41:51 AM: ❯ Flags
4:41:51 AM: baseRelDir: true
4:41:51 AM: buildId: 6132eaee40b1535456fa2214
4:41:51 AM: deployId: 6132eaee40b1535456fa2216
4:41:51 AM: ​
4:41:51 AM: ❯ Current directory
4:41:51 AM: /opt/build/repo
4:41:51 AM: ​
4:41:51 AM: ❯ Config file
4:41:51 AM: No config file was defined: using default values.
4:41:51 AM: ​
4:41:51 AM: ❯ Context
4:41:51 AM: production
4:41:51 AM: ​
4:41:51 AM: ────────────────────────────────────────────────────────────────
4:41:51 AM: 1. Build command from Netlify app
4:41:51 AM: ────────────────────────────────────────────────────────────────
4:41:51 AM: ​
4:41:51 AM: $ npm run build
4:41:51 AM: npm ERR! Missing script: “build”
4:41:51 AM: npm ERR!
4:41:51 AM: npm ERR! To see a list of scripts, run:
4:41:51 AM: npm ERR! npm run
4:41:51 AM: npm ERR! A complete log of this run can be found in:
4:41:51 AM: npm ERR! /opt/buildhome/.npm/_logs/2021-09-04T03_41_51_696Z-debug.log
4:41:51 AM: ​
4:41:51 AM: ────────────────────────────────────────────────────────────────
4:41:51 AM: “build.command” failed
4:41:51 AM: ────────────────────────────────────────────────────────────────
4:41:51 AM: ​
4:41:51 AM: Error message
4:41:51 AM: Command failed with exit code 1: npm run build
4:41:51 AM: ​
4:41:51 AM: Error location
4:41:51 AM: In Build command from Netlify app:
4:41:51 AM: npm run build
4:41:51 AM: ​
4:41:51 AM: Resolved config
4:41:51 AM: build:
4:41:51 AM: command: npm run build
4:41:51 AM: commandOrigin: ui
4:41:51 AM: publish: /opt/build/repo/images
4:41:51 AM: publishOrigin: ui
4:41:52 AM: Caching artifacts
4:41:52 AM: Started saving node modules
4:41:52 AM: Finished saving node modules
4:41:52 AM: Started saving build plugins
4:41:52 AM: Finished saving build plugins
4:41:52 AM: Started saving pip cache
4:41:52 AM: Finished saving pip cache
4:41:52 AM: Started saving emacs cask dependencies
4:41:52 AM: Finished saving emacs cask dependencies
4:41:52 AM: Started saving maven dependencies
4:41:52 AM: Finished saving maven dependencies
4:41:52 AM: Started saving boot dependencies
4:41:52 AM: Finished saving boot dependencies
4:41:52 AM: Started saving rust rustup cache
4:41:52 AM: Finished saving rust rustup cache
4:41:52 AM: Started saving go dependencies
4:41:52 AM: Finished saving go dependencies
4:41:54 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
4:41:54 AM: Creating deploy upload records
4:41:54 AM: Failing build: Failed to build site
4:41:54 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
4:41:54 AM: Finished processing build request in 18.085167322s

The package.json at the root of the git repository you are trying to deploy has no build script, even though you have specified npm run build as the build command.

There is a build-css script though.

"scripts": {
  "build-css": "tailwindcss build src/styles.css -o public/styles.css"
},

Thanks @coelmay . i have just added the script but still getting same error

You have nothing that need building @ade777 as styles.css is already in your public folder.

Move the contents of the public directory into the root of your git repository, remove the build command (it is not required) and publish directory (the repository root is what is published) then deploy your site.

Thank you . Its working now