"build.command" failed. Command failed with exit code 1: parcel build index.html

PLEASE help :frowning: !

Error messages:

12:20:10 AM: Build ready to start
12:20:12 AM: build-image version: d7b3dbfb0846505993c9a131894d1858074c90b4 (focal)
12:20:12 AM: build-image tag: v4.10.1
12:20:12 AM: buildbot version: 4cffa5dc84445a450e8be6f710e2498d87994fae
12:20:12 AM: Fetching cached dependencies
12:20:12 AM: Failed to fetch cache, continuing with build
12:20:12 AM: Starting to prepare the repo for build
12:20:12 AM: No cached dependencies found. Cloning fresh repo
12:20:12 AM: git clone https://github.com/NestorS5/moshify.2
12:20:12 AM: Preparing Git Reference refs/heads/main
12:20:13 AM: Parsing package.json dependencies
12:20:14 AM: Starting build script
12:20:14 AM: Installing dependencies
12:20:14 AM: Python version set to 2.7
12:20:14 AM: Downloading and installing node v16.17.0...
12:20:14 AM: Downloading https://nodejs.org/dist/v16.17.0/node-v16.17.0-linux-x64.tar.xz...
12:20:14 AM: Computing checksum with sha256sum
12:20:14 AM: Checksums matched!
12:20:17 AM: Now using node v16.17.0 (npm v8.15.0)
12:20:17 AM: Started restoring cached build plugins
12:20:17 AM: Finished restoring cached build plugins
12:20:17 AM: Attempting ruby version 2.7.2, read from environment
12:20:17 AM: Using ruby version 2.7.2
12:20:17 AM: Using PHP version 8.0
12:20:18 AM: No npm workspaces detected
12:20:18 AM: Started restoring cached node modules
12:20:18 AM: Finished restoring cached node modules
12:20:18 AM: Installing NPM modules using NPM version 8.15.0
12:20:18 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
12:20:18 AM: npm WARN config location in the cache, and they are managed by
12:20:18 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
12:20:18 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
12:20:18 AM: npm WARN config location in the cache, and they are managed by
12:20:18 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
12:20:20 AM: npm WARN deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
12:20:20 AM: npm WARN deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
12:20:20 AM: npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
12:20:20 AM: npm WARN deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
12:20:21 AM: npm WARN deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
12:20:21 AM: npm WARN deprecated querystring@0.2.0: The querystring API is considered Legacy. new code should use the URLSearchParams API instead.
12:20:21 AM: npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
12:20:21 AM: npm WARN deprecated har-validator@5.1.5: this library is no longer supported
12:20:22 AM: npm WARN deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
12:20:23 AM: npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
12:20:23 AM: npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
12:20:23 AM: npm WARN deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
12:20:23 AM: npm WARN deprecated parcel-bundler@1.12.4: Parcel v1 is no longer maintained. Please migrate to v2, which is published under the 'parcel' package. See https://v2.parceljs.org/getting-started/migration for details.
12:20:24 AM: npm WARN deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
12:20:24 AM: added 801 packages, and audited 802 packages in 6s
12:20:24 AM: 59 packages are looking for funding
12:20:24 AM:   run `npm fund` for details
12:20:24 AM: 23 vulnerabilities (9 moderate, 14 high)
12:20:24 AM: To address issues that do not require attention, run:
12:20:24 AM:   npm audit fix
12:20:24 AM: To address all issues (including breaking changes), run:
12:20:24 AM:   npm audit fix --force
12:20:24 AM: Run `npm audit` for details.
12:20:24 AM: NPM modules installed
12:20:24 AM: npm WARN config tmp This setting is no longer used.  npm stores temporary files in a special
12:20:24 AM: npm WARN config location in the cache, and they are managed by
12:20:24 AM: npm WARN config     [`cacache`](http://npm.im/cacache).
12:20:25 AM: Started restoring cached go cache
12:20:25 AM: Finished restoring cached go cache
12:20:25 AM: Installing Go version 1.17 (requested 1.17)
12:20:29 AM: unset GOOS;
12:20:29 AM: unset GOARCH;
12:20:29 AM: export GOROOT='/opt/buildhome/.gimme/versions/go1.17.linux.amd64';
12:20:29 AM: export PATH="/opt/buildhome/.gimme/versions/go1.17.linux.amd64/bin:${PATH}";
12:20:29 AM: go version >&2;
12:20:29 AM: export GIMME_ENV="/opt/buildhome/.gimme/env/go1.17.linux.amd64.env"
12:20:29 AM: go version go1.17 linux/amd64
12:20:29 AM: Installing missing commands
12:20:29 AM: Verify run directory
12:20:30 AM: ​
12:20:30 AM: ────────────────────────────────────────────────────────────────
12:20:30 AM:   Netlify Build                                                 
12:20:30 AM: ────────────────────────────────────────────────────────────────
12:20:30 AM: ​
12:20:30 AM: ❯ Version
12:20:30 AM:   @netlify/build 27.11.5
12:20:30 AM: ​
12:20:30 AM: ❯ Flags
12:20:30 AM:   baseRelDir: true
12:20:30 AM:   buildId: 62ff1d8aa89f614211387467
12:20:30 AM:   deployId: 62ff1d8aa89f614211387469
12:20:30 AM: ​
12:20:30 AM: ❯ Current directory
12:20:30 AM:   /opt/build/repo
12:20:30 AM: ​
12:20:30 AM: ❯ Config file
12:20:30 AM:   No config file was defined: using default values.
12:20:30 AM: ​
12:20:30 AM: ❯ Context
12:20:30 AM:   production
12:20:30 AM: ​
12:20:30 AM: ────────────────────────────────────────────────────────────────
12:20:30 AM:   1. Build command from Netlify app                             
12:20:30 AM: ────────────────────────────────────────────────────────────────
12:20:30 AM: ​
12:20:30 AM: $ parcel build index.html
12:20:31 AM: 🚨  /opt/build/repo/images/sprite.svg: Invalid Version: undefined
12:20:31 AM:     at new SemVer (/opt/build/repo/node_modules/@babel/preset-env/node_modules/semver/semver.js:314:11)
12:20:31 AM:     at compare (/opt/build/repo/node_modules/@babel/preset-env/node_modules/semver/semver.js:647:10)
12:20:31 AM:     at Function.lt (/opt/build/repo/node_modules/@babel/preset-env/node_modules/semver/semver.js:688:10)
12:20:31 AM:     at /opt/build/repo/node_modules/@babel/preset-env/lib/index.js:275:15
12:20:31 AM:     at Object.default (/opt/build/repo/node_modules/@babel/helper-plugin-utils/lib/index.js:23:12)
12:20:31 AM:     at getEnvPlugins (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/env.js:62:34)
12:20:31 AM:     at getEnvConfig (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/env.js:12:25)
12:20:31 AM:     at async getBabelConfig (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/config.js:32:19)
12:20:31 AM:     at async babelTransform (/opt/build/repo/node_modules/parcel-bundler/src/transforms/babel/transform.js:6:16)
12:20:31 AM:     at async JSAsset.pretransform (/opt/build/repo/node_modules/parcel-bundler/src/assets/JSAsset.js:83:5)
12:20:32 AM: ​
12:20:32 AM: ────────────────────────────────────────────────────────────────
12:20:32 AM:   "build.command" failed                                        
12:20:32 AM: ────────────────────────────────────────────────────────────────
12:20:32 AM: ​
12:20:32 AM:   Error message
12:20:32 AM:   Command failed with exit code 1: parcel build index.html (https://ntl.fyi/exit-code-1)
12:20:32 AM: ​
12:20:32 AM:   Error location
12:20:32 AM:   In Build command from Netlify app:
12:20:32 AM:   parcel build index.html
12:20:32 AM: ​
12:20:32 AM:   Resolved config
12:20:32 AM:   build:
12:20:32 AM:     command: parcel build index.html
12:20:32 AM:     commandOrigin: ui
12:20:32 AM:     environment:
12:20:32 AM:       - CI
12:20:32 AM:     publish: /opt/build/repo/dist
12:20:32 AM:     publishOrigin: ui
12:20:33 AM: Caching artifacts
12:20:33 AM: Started saving node modules
12:20:33 AM: Finished saving node modules
12:20:33 AM: Started saving build plugins
12:20:33 AM: Finished saving build plugins
12:20:33 AM: Started saving pip cache
12:20:33 AM: Finished saving pip cache
12:20:33 AM: Started saving emacs cask dependencies
12:20:33 AM: Finished saving emacs cask dependencies
12:20:33 AM: Started saving maven dependencies
12:20:33 AM: Finished saving maven dependencies
12:20:33 AM: Started saving boot dependencies
12:20:33 AM: Finished saving boot dependencies
12:20:33 AM: Started saving rust rustup cache
12:20:33 AM: Finished saving rust rustup cache
12:20:33 AM: Started saving go dependencies
12:20:33 AM: Finished saving go dependencies
12:20:34 AM: Build failed due to a user error: Build script returned non-zero exit code: 2
12:20:34 AM: Creating deploy upload records
12:20:34 AM: Failing build: Failed to build site
12:20:34 AM: Failed during stage 'building site': Build script returned non-zero exit code: 2 (https://ntl.fyi/exit-code-2)
12:20:34 AM: Finished processing build request in 22.492947662s```

Hiya, sorry you are having trouble with your build.

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile: Additionally, this Support Guide houses all of our resources for debugging build and deploy issues.

We also recommend trying to search the forums with the build error you encountered - it’s likely your question was already asked by someone else!

If you are still having problems, please provide as much information as you can on what you have already tried, what your build settings are, your package.json, etc. Thanks!

2 Likes

Hey @Samnestor5

This issue is the same as Build failed due to a user error. Build script returned non-zero exit code: 2.

I posted a possible solution on that thread (I say possible as the OP hasn’t yet replied to say if it worked or not) which entails turning off SVG minification as per Parcel documentation.