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

Hi, I could work in continuous deployment but suddenly it no longer works well, it gives me the following error:

12:12:04 AM: Build ready to start
12:12:06 AM: build-image version: 7b53c5fc4445e3ec99d3949e5d1174a8c5be4f16
12:12:06 AM: build-image tag: v3.7.2
12:12:06 AM: buildbot version: af9581a1b3313dc235fa26c62d25d6ae954cae6e
12:12:06 AM: Fetching cached dependencies
12:12:06 AM: Starting to download cache of 203.7MB
12:12:15 AM: Finished downloading cache in 9.042165905s
12:12:15 AM: Starting to extract cache
12:12:22 AM: Finished extracting cache in 7.495410164s
12:12:23 AM: Finished fetching cache in 16.614020602s
12:12:23 AM: Starting to prepare the repo for build
12:12:23 AM: Preparing Git Reference refs/heads/main
12:12:27 AM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
12:12:27 AM: Starting build script
12:12:27 AM: Installing dependencies
12:12:27 AM: Python version set to 2.7
12:12:28 AM: Started restoring cached node version
12:12:30 AM: Finished restoring cached node version
12:12:31 AM: v12.18.0 is already installed.
12:12:31 AM: Now using node v12.18.0 (npm v6.14.4)
12:12:32 AM: Started restoring cached build plugins
12:12:32 AM: Finished restoring cached build plugins
12:12:32 AM: Attempting ruby version 2.7.1, read from environment
12:12:33 AM: Using ruby version 2.7.1
12:12:33 AM: Using PHP version 5.6
12:12:33 AM: Started restoring cached node modules
12:12:33 AM: Finished restoring cached node modules
12:12:34 AM: Installing NPM modules using NPM version 6.14.4
12:13:27 AM: npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I’ll try to do my best with it!npm WARN rm not removing /opt/build/repo/node_modules/.bin/jest as it wasn’t installed by /opt/build/repo/node_modules/jestnpm WARN rm not removing /opt/build/repo/node_modules/.bin/rimraf as it wasn’t installed by /opt/build/repo/node_modules/rimrafnpm WARN rm not removing /opt/build/repo/node_modules/.bin/uuid as it wasn’t installed by /opt/build/repo/node_modules/uuidnpm WARN rm not removing /opt/build/repo/node_modules/.bin/semver as it wasn’t installed by /opt/build/repo/node_modules/semvernpm WARN rm not removing /opt/build/repo/node_modules/.bin/mkdirp as it wasn’t installed by /opt/build/repo/node_modules/mkdirpnpm WARN rm not removing /opt/build/repo/node_modules/.bin/json5 as it wasn’t installed by /opt/build/repo/node_modules/json5
12:13:27 AM: > core-js@2.6.12 postinstall /opt/build/repo/node_modules/babel-runtime/node_modules/core-js
12:13:27 AM: > node -e “try{require(’./postinstall’)}catch(e){}”
12:13:27 AM: > core-js@3.6.5 postinstall /opt/build/repo/node_modules/core-js
12:13:27 AM: > node -e “try{require(’./postinstall’)}catch(e){}”
12:13:27 AM: > core-js-pure@3.11.0 postinstall /opt/build/repo/node_modules/core-js-pure
12:13:27 AM: > node -e “try{require(’./postinstall’)}catch(e){}”
12:13:27 AM: > ejs@2.7.4 postinstall /opt/build/repo/node_modules/ejs
12:13:27 AM: > node ./postinstall.js
12:13:28 AM: > protobufjs@6.10.2 postinstall /opt/build/repo/node_modules/protobufjs
12:13:28 AM: > node scripts/postinstall
12:13:31 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
12:13:31 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:13:31 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
12:13:31 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:13:31 AM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules/fsevents):
12:13:31 AM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
12:13:31 AM: added 419 packages from 172 contributors, removed 206 packages, updated 1550 packages and audited 1976 packages in 56.309s
12:13:33 AM: 135 packages are looking for funding
12:13:33 AM: run npm fund for details
12:13:33 AM: found 0 vulnerabilities
12:13:33 AM: NPM modules installed
12:13:33 AM: Started restoring cached go cache
12:13:33 AM: Finished restoring cached go cache
12:13:33 AM: go version go1.14.4 linux/amd64
12:13:33 AM: go version go1.14.4 linux/amd64
12:13:33 AM: Installing missing commands
12:13:33 AM: Verify run directory
12:13:35 AM: ​
12:13:35 AM: ────────────────────────────────────────────────────────────────
12:13:35 AM: Netlify Build
12:13:35 AM: ────────────────────────────────────────────────────────────────
12:13:35 AM: ​
12:13:35 AM: ❯ Version
12:13:35 AM: @netlify/build 11.3.1
12:13:35 AM: ​
12:13:35 AM: ❯ Flags
12:13:35 AM: deployId: 60888c3445bdb30007d746c0
12:13:35 AM: ​
12:13:35 AM: ❯ Current directory
12:13:35 AM: /opt/build/repo
12:13:35 AM: ​
12:13:35 AM: ❯ Config file
12:13:35 AM: No config file was defined: using default values.
12:13:35 AM: ​
12:13:35 AM: ❯ Context
12:13:35 AM: production
12:13:35 AM: ​
12:13:35 AM: ────────────────────────────────────────────────────────────────
12:13:35 AM: 1. Build command from Netlify app
12:13:35 AM: ────────────────────────────────────────────────────────────────
12:13:35 AM: ​
12:13:35 AM: $ CI= npm run build
12:13:36 AM: > frontendp@0.1.0 build /opt/build/repo
12:13:36 AM: > react-scripts build
12:13:37 AM: Creating an optimized production build…
12:13:47 AM: Failed to compile.
12:13:47 AM:
12:13:47 AM: ./src/components/header_components/SearchFood.jsx
12:13:47 AM: Cannot find file ‘…/…/functions/searchFoodFunctions’ in ‘./src/components/header_components’.
12:13:47 AM: npm ERR! code ELIFECYCLE
12:13:47 AM: npm ERR! errno 1
12:13:47 AM: npm ERR! frontendp@0.1.0 build: react-scripts build
12:13:47 AM: npm ERR! Exit status 1
12:13:47 AM: npm ERR!
12:13:47 AM: npm ERR! Failed at the frontendp@0.1.0 build script.
12:13:47 AM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
12:13:47 AM: npm ERR! A complete log of this run can be found in:
12:13:47 AM: npm ERR! /opt/buildhome/.npm/_logs/2021-04-27T22_13_47_150Z-debug.log
12:13:47 AM: ​
12:13:47 AM: ────────────────────────────────────────────────────────────────
12:13:47 AM: “build.command” failed
12:13:47 AM: ────────────────────────────────────────────────────────────────
12:13:47 AM: ​
12:13:47 AM: Error message
12:13:47 AM: Command failed with exit code 1: CI= npm run build
12:13:47 AM: ​
12:13:47 AM: Error location
12:13:47 AM: In Build command from Netlify app:
12:13:47 AM: CI= npm run build
12:13:47 AM: ​
12:13:47 AM: Resolved config
12:13:47 AM: build:
12:13:47 AM: command: CI= npm run build
12:13:47 AM: commandOrigin: ui
12:13:47 AM: publish: /opt/build/repo/build
12:13:47 AM: Caching artifacts
12:13:47 AM: Started saving node modules
12:13:47 AM: Finished saving node modules
12:13:47 AM: Started saving build plugins
12:13:47 AM: Finished saving build plugins
12:13:47 AM: Started saving pip cache
12:13:47 AM: Finished saving pip cache
12:13:47 AM: Started saving emacs cask dependencies
12:13:47 AM: Finished saving emacs cask dependencies
12:13:47 AM: Started saving maven dependencies
12:13:47 AM: Finished saving maven dependencies
12:13:47 AM: Started saving boot dependencies
12:13:47 AM: Finished saving boot dependencies
12:13:47 AM: Started saving rust rustup cache
12:13:47 AM: Finished saving rust rustup cache
12:13:47 AM: Started saving go dependencies
12:13:47 AM: Finished saving go dependencies
12:13:47 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:13:47 AM: Creating deploy upload records
12:13:47 AM: Failing build: Failed to build site
12:13:47 AM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
12:13:48 AM: Finished processing build request in 1m41.787153959s

Thank you very much for your help!

hi there, it looks like that file can’t be found.

What you are describing sounds a bit like a an issue with case sensitivity on our system.

Can you give this a read through and let us know if that fixes the issue?

Thank you very much for your support, I renamed the file and it worked (problem case sensitive searchFoodFunctions to search_food_functions).

1 Like