Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command failed with exit code 1: CI= npm run build

I've been losing my mind over this
I've used this video as reference but I'm still getting the error below
I've tried everything from Netlify Form to youtube and Stackoverflow

5:33:23 AM: ────────────────────────────────────────────────────────────────
5:33:23 AM:   "build.command" failed                                        
5:33:23 AM: ────────────────────────────────────────────────────────────────
5:33:23 AM: ​
5:33:23 AM:   Error message
5:33:23 AM:   Command failed with exit code 1: CI= npm run build
5:33:23 AM: ​
5:33:23 AM:   Error location
5:33:23 AM:   In Build command from Netlify app:
5:33:23 AM:   CI= npm run build
5:33:23 AM: ​
5:33:23 AM:   Resolved config
5:33:23 AM:   build:
5:33:23 AM:     command: CI= npm run build
5:33:23 AM:     commandOrigin: ui
5:33:23 AM:     publish: /opt/build/repo/dist

My package.json file

{
  "name": "testing",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "./node_modules/.bin/netlify-lambda serve src",
    "build": "CI= npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/<my-username>/testing.git"
  },
  "author": "",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/<my-username>/testing/issues"
  },
  "homepage": "https://github.com/<my-username>/testing#readme",
  "dependencies": {
    "express": "^4.17.1",
    "netlify-lambda": "^2.0.6",
    "serverless-http": "^2.7.0"
  }
}

My netlify.toml

[build]

functions = "functions"

Deployment settings enter image description here

What am I missing? please help I'm losing my hair over this


1 Answers

Generally, libraries that choose to fail on warnings presume their users will want to fix the issues causing the warnings. If this isn’t practical for your use case, you can override the CI variable by adding CI='' to the beginning of your site build command. For example:

CI='' npm run build

This fixed my own similar problem

like image 199
PRONO Avatar answered Jul 12 '26 02:07

PRONO



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!