Home
Support Forums

"build.command" failed

I need advice to debug deploy Netlify App
here is mine build settings


here is my package.json
{
“name”: “power-system-experts-client”,
“version”: “0.1.0”,
“private”: false,
“homepage”: “”,
“basename”: “/”,
“dependencies”: {
@babel/core”: “7.1.0”,
@svgr/webpack”: “2.4.1”,
“babel-core”: “7.0.0-bridge.0”,
“babel-jest”: “23.6.0”,
“babel-loader”: “8.0.4”,
“babel-plugin-named-asset-import”: “^0.2.3”,
“babel-preset-react-app”: “^6.1.0”,
“bfj”: “6.1.1”,
“case-sensitive-paths-webpack-plugin”: “2.1.2”,
“chalk”: “2.4.1”,
“css-loader”: “1.0.0”,
“dotenv”: “6.0.0”,
“dotenv-expand”: “4.2.0”,
“eslint”: “5.6.0”,
“eslint-config-react-app”: “^3.0.5”,
“eslint-loader”: “2.1.1”,
“eslint-plugin-flowtype”: “2.50.1”,
“eslint-plugin-import”: “2.14.0”,
“eslint-plugin-jsx-a11y”: “6.1.2”,
“eslint-plugin-react”: “7.11.1”,
“fetch-instagram”: “^1.0.0-alpha.3”,
“file-loader”: “2.0.0”,
“fork-ts-checker-webpack-plugin-alt”: “0.4.14”,
“formik”: “1.5.8”,
“fs-extra”: “7.0.0”,
“html-webpack-plugin”: “4.0.0-alpha.2”,
“identity-obj-proxy”: “3.0.0”,
“instagram-api”: “^1.0.3”,
“jest”: “23.6.0”,
“jest-pnp-resolver”: “1.0.1”,
“jest-resolve”: “23.6.0”,
“lodash”: “^4.17.15”,
“mini-css-extract-plugin”: “0.4.3”,
“node-sass”: “^4.14.1”,
“optimize-css-assets-webpack-plugin”: “5.0.1”,
“pnp-webpack-plugin”: “1.1.0”,
“postcss-flexbugs-fixes”: “4.1.0”,
“postcss-loader”: “3.0.0”,
“postcss-preset-env”: “6.0.6”,
“postcss-safe-parser”: “4.0.1”,
“qs”: “^6.9.4”,
“react”: “^16.6.3”,
“react-anchor-link-smooth-scroll”: “^1.0.12”,
“react-app-polyfill”: “^0.1.3”,
“react-dev-utils”: “^6.1.1”,
“react-dom”: “^16.6.1”,
“react-helmet”: “^5.2.1”,
“react-image-magnifiers”: “^1.0.3”,
“react-image-zoom”: “^0.7.0”,
“react-infinite-scroll-component”: “^4.2.0”,
“react-input-range”: “^1.3.0”,
“react-instafeed”: “^0.4.0”,
“react-loading-bar”: “0.0.7”,
“react-pace-progress”: “^2.0.0”,
“react-paypal-express-checkout”: “^1.0.5”,
“react-redux”: “^5.1.1”,
“react-redux-loading-bar”: “^4.1.0”,
“react-redux-multilingual”: “^2.0.2”,
“react-responsive-modal”: “^3.5.1”,
“react-router-dom”: “^4.3.1”,
“react-router-scroll-4”: “^1.0.0-beta.2”,
“react-scripts”: “^2.1.1”,
“react-slick”: “^0.21.0”,
“react-slide-toggle”: “^0.1.13”,
“react-sticky-box”: “^0.7.5”,
“react-tabs”: “^2.3.0”,
“react-toastify”: “^4.4.3”,
“react-topbar-progress-indicator”: “^2.0.0”,
“redux”: “^4.0.1”,
“redux-infinite-scroll”: “^1.0.9”,
“redux-logger”: “^3.0.6”,
“redux-thunk”: “^2.3.0”,
“resolve”: “1.8.1”,
“simple-react-validator”: “^1.0.1”,
“slick-carousel”: “^1.8.1”,
“smartmenus”: “^1.1.0”,
“style-loader”: “0.23.0”,
“terser-webpack-plugin”: “1.1.0”,
“url-loader”: “1.1.1”,
“webpack-dev-server”: “3.1.9”,
“webpack-manifest-plugin”: “2.0.4”,
“workbox-webpack-plugin”: “3.6.3”,
“yup”: “^0.29.1”
},
“scripts”: {
“start”: “node scripts/start.js”,
“build”: “react-scripts build”,
“test”: “node scripts/test.js”
},
“eslintConfig”: {
“extends”: “react-app”
},
“browserslist”: [
“>0.2%”,
“not dead”,
“not ie <= 11”,
“not op_mini all”
],
“jest”: {
“collectCoverageFrom”: [
“src//*.{js,jsx,ts,tsx}",
"!src/
/.d.ts"
],
“resolver”: “jest-pnp-resolver”,
“setupFiles”: [
“react-app-polyfill/jsdom”
],
“testMatch”: [
"/src//tests//
.{js,jsx,ts,tsx}”,
“/src/**/?(.)(spec|test).{js,jsx,ts,tsx}"
],
“testEnvironment”: “jsdom”,
“testURL”: “http://localhost”,
“transform”: {
“^.+\.(js|jsx|ts|tsx)$”: “/node_modules/babel-jest”,
“^.+\.css$”: “/config/jest/cssTransform.js”,
"^(?!.
\.(js|jsx|ts|tsx|css|json)$)”: “/config/jest/fileTransform.js”
},
“transformIgnorePatterns”: [
“[/\\]node_modules[/\\].+\.(js|jsx|ts|tsx)$”,
“^.+\.module\.(css|sass|scss)$”
],
“moduleNameMapper”: {
“^react-native$”: “react-native-web”,
“^.+\.module\.(css|sass|scss)$”: “identity-obj-proxy”
},
“moduleFileExtensions”: [
“web.js”,
“js”,
“web.ts”,
“ts”,
“web.tsx”,
“tsx”,
“json”,
“web.jsx”,
“jsx”,
“node”
]
},
“babel”: {
“presets”: [
“react-app”
]
},
“devDependencies”: {}
}

Hi @QaimAli,

You need to remove your .env file . It currently contains only:

CI=true npm run build

This does not follow the syntax for .env. Also, this removes the CI= workaround.

Also, please note you do not need to prefix CI= to both your Netlify build command and the build script in package.json, but only one of them.

Please let us know if this fixed your problem.

Thanks , it solved my problem

1 Like

Hi!

I read this thread and tried changing the Netlify build command from jekyll build to CI= jekyll build. But it still shows me the same “build.command” failed. Could you help me on this? Below is part of my deploy log when it mentions the build failure.

11:38:25 PM: ────────────────────────────────────────────────────────────────
11:38:25 PM: “build.command” failed
11:38:25 PM: ────────────────────────────────────────────────────────────────
11:38:25 PM: ​
11:38:25 PM: Error message
11:38:25 PM: Command failed with exit code 1: CI= jekyll build
11:38:25 PM: ​
11:38:25 PM: Error location
11:38:25 PM: In Build command from Netlify app:
11:38:25 PM: CI= jekyll build
11:38:25 PM: ​
11:38:25 PM: Resolved config
11:38:25 PM: build:
11:38:25 PM: command: CI= jekyll build
11:38:25 PM: commandOrigin: ui
11:38:25 PM: publish: /opt/build/repo/_site
11:38:25 PM: Caching artifacts
11:38:25 PM: Started saving ruby gems
11:38:25 PM: Finished saving ruby gems
11:38:25 PM: Started saving bower components
11:38:25 PM: Finished saving bower components
11:38:25 PM: Started saving node modules
11:38:25 PM: Finished saving node modules
11:38:25 PM: Started saving build plugins
11:38:25 PM: Finished saving build plugins
11:38:25 PM: Started saving pip cache
11:38:25 PM: Finished saving pip cache
11:38:25 PM: Started saving emacs cask dependencies
11:38:25 PM: Finished saving emacs cask dependencies
11:38:25 PM: Started saving maven dependencies
11:38:25 PM: Finished saving maven dependencies
11:38:25 PM: Started saving boot dependencies
11:38:25 PM: Finished saving boot dependencies
11:38:25 PM: Started saving rust rustup cache
11:38:25 PM: Finished saving rust rustup cache
11:38:25 PM: Started saving go dependencies
11:38:25 PM: Finished saving go dependencies
11:38:28 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
11:38:28 PM: Failing build: Failed to build site
11:38:28 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
11:38:28 PM: Finished processing build request in 1m14.464302554s

Hey!
I’m trying to debug too as it shows me the same “build.command” failure error. I’ve attached my deploy log below, thanks in advance!:
8:32:01 PM: Waiting for other deploys from your team to complete
8:32:24 PM: Build ready to start
8:32:26 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
8:32:26 PM: build-image tag: v3.6.1
8:32:26 PM: buildbot version: 44655717ddf0e7bd7f856f5b1154254de54b1d80
8:32:26 PM: Fetching cached dependencies
8:32:26 PM: Failed to fetch cache, continuing with build
8:32:26 PM: Starting to prepare the repo for build
8:32:27 PM: No cached dependencies found. Cloning fresh repo
8:32:27 PM: git clone https://github.com/jenniferjyz/jenniferjyz.github.io
8:32:41 PM: Preparing Git Reference refs/heads/master
8:32:44 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘public’ versus ‘public/’ in the Netlify UI
8:32:44 PM: Starting build script
8:32:44 PM: Installing dependencies
8:32:44 PM: Python version set to 2.7
8:32:45 PM: v12.18.0 is already installed.
8:32:46 PM: Now using node v12.18.0 (npm v6.14.4)
8:32:46 PM: Started restoring cached build plugins
8:32:46 PM: Finished restoring cached build plugins
8:32:46 PM: Attempting ruby version 2.7.1, read from environment
8:32:48 PM: Using ruby version 2.7.1
8:32:48 PM: Using PHP version 5.6
8:32:48 PM: Started restoring cached node modules
8:32:51 PM: Finished restoring cached node modules
8:32:52 PM: Installing NPM modules using NPM version 6.14.4
8:33:54 PM: > sharp@0.25.4 install /opt/build/repo/node_modules/gatsby-plugin-sharp/node_modules/sharp
8:33:54 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
8:33:55 PM: info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.9.1/libvips-8.9.1-linux-x64.tar.gz
8:33:57 PM: > sharp@0.25.2 install /opt/build/repo/node_modules/sharp
8:33:57 PM: > (node install/libvips && node install/dll-copy && prebuild-install --runtime=napi) || (node-gyp rebuild && node install/dll-copy)
8:33:58 PM: info sharp Using cached /opt/buildhome/.npm/_libvips/libvips-8.9.1-linux-x64.tar.gz
8:34:00 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/bmp/node_modules/core-js
8:34:00 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:00 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/core/node_modules/core-js
8:34:00 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:00 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/custom/node_modules/core-js
8:34:00 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:00 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/gif/node_modules/core-js
8:34:00 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:00 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/jpeg/node_modules/core-js
8:34:00 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-blit/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-blur/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-circle/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-color/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-contain/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-cover/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-crop/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-displace/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-dither/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-fisheye/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-flip/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:01 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-gaussian/node_modules/core-js
8:34:01 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-invert/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-mask/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-normalize/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-print/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-resize/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-rotate/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-scale/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-shadow/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugin-threshold/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/plugins/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/png/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:02 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/tiff/node_modules/core-js
8:34:02 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:03 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/types/node_modules/core-js
8:34:03 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:03 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/@jimp/utils/node_modules/core-js
8:34:03 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:03 PM: > core-js@2.6.10 postinstall /opt/build/repo/node_modules/core-js
8:34:03 PM: > node postinstall || echo “ignore”
8:34:03 PM: > core-js-pure@3.6.4 postinstall /opt/build/repo/node_modules/core-js-pure
8:34:03 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:03 PM: > core-js@2.6.11 postinstall /opt/build/repo/node_modules/gatsby/node_modules/core-js
8:34:03 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:04 PM: > core-js@3.6.4 postinstall /opt/build/repo/node_modules/jimp/node_modules/core-js
8:34:04 PM: > node -e “try{require(’./postinstall’)}catch(e){}”
8:34:05 PM: > gatsby-telemetry@1.3.35 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-telemetry
8:34:05 PM: > node src/postinstall.js || true
8:34:05 PM: > mozjpeg@7.0.0 postinstall /opt/build/repo/node_modules/mozjpeg
8:34:05 PM: > node lib/install.js
8:34:05 PM: :heavy_check_mark: mozjpeg pre-build test passed successfully
8:34:05 PM: > pngquant-bin@6.0.0 postinstall /opt/build/repo/node_modules/pngquant-bin
8:34:05 PM: > node lib/install.js
8:34:06 PM: :heavy_check_mark: pngquant pre-build test passed successfully
8:34:06 PM: > gatsby@2.20.3 postinstall /opt/build/repo/node_modules/gatsby
8:34:06 PM: > node scripts/postinstall.js
8:34:06 PM: > gatsby-cli@2.12.99 postinstall /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli
8:34:06 PM: > node scripts/postinstall.js
8:34:06 PM: > styled-components@4.4.1 postinstall /opt/build/repo/node_modules/styled-components
8:34:06 PM: > node ./scripts/postinstall.js || exit 0
8:34:06 PM: Use styled-components at work? Consider supporting our development efforts at https://opencollective.com/styled-components
8:34:09 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.12 (node_modules/fsevents):
8:34:09 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.12: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:34:09 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/gatsby/node_modules/fsevents):
8:34:09 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:34:09 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/gatsby-page-utils/node_modules/fsevents):
8:34:09 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:34:09 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules/chokidar/node_modules/fsevents):
8:34:09 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“linux”,“arch”:“x64”})
8:34:09 PM: added 2625 packages from 1084 contributors and audited 2651 packages in 76.965s
8:34:12 PM: 102 packages are looking for funding
8:34:12 PM: run npm fund for details
8:34:12 PM: found 20 vulnerabilities (17 low, 3 high)
8:34:12 PM: run npm audit fix to fix them, or npm audit for details
8:34:12 PM: NPM modules installed
8:34:12 PM: Started restoring cached go cache
8:34:12 PM: Finished restoring cached go cache
8:34:12 PM: go version go1.14.4 linux/amd64
8:34:12 PM: go version go1.14.4 linux/amd64
8:34:12 PM: Installing missing commands
8:34:12 PM: Verify run directory
8:34:14 PM: ​
8:34:14 PM: ────────────────────────────────────────────────────────────────
8:34:14 PM: Netlify Build
8:34:14 PM: ────────────────────────────────────────────────────────────────
8:34:14 PM: ​
8:34:14 PM: ❯ Version
8:34:14 PM: @netlify/build 8.3.0
8:34:14 PM: ​
8:34:14 PM: ❯ Flags
8:34:14 PM: deployId: 6010c2913317e44d91238565
8:34:14 PM: mode: buildbot
8:34:14 PM: ​
8:34:14 PM: ❯ Current directory
8:34:14 PM: /opt/build/repo
8:34:14 PM: ​
8:34:14 PM: ❯ Config file
8:34:14 PM: No config file was defined: using default values.
8:34:14 PM: ​
8:34:14 PM: ❯ Context
8:34:14 PM: production
8:34:14 PM: ​
8:34:14 PM: ────────────────────────────────────────────────────────────────
8:34:14 PM: 1. Build command from Netlify app
8:34:14 PM: ────────────────────────────────────────────────────────────────
8:34:14 PM: ​
8:34:14 PM: $ gatsby build
8:34:15 PM: internal/modules/cjs/loader.js:969
8:34:15 PM: throw err;
8:34:15 PM: ^
8:34:15 PM: Error: Cannot find module ‘yurnalist’
8:34:15 PM: Require stack:
8:34:15 PM: - /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/loggers/yurnalist/index.js
8:34:15 PM: - /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/start-logger.js
8:34:15 PM: - /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js
8:34:15 PM: - /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/create-cli.js
8:34:15 PM: - /opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/index.js
8:34:15 PM: - /opt/build/repo/node_modules/gatsby/dist/bin/gatsby.js
8:34:15 PM: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:966:15)
8:34:15 PM: at Function.Module._load (internal/modules/cjs/loader.js:842:27)
8:34:15 PM: at Module.require (internal/modules/cjs/loader.js:1026:19)
8:34:15 PM: at require (internal/modules/cjs/helpers.js:72:18)
8:34:15 PM: at Object. (/opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/loggers/yurnalist/index.js:12:18)
8:34:15 PM: at Module._compile (internal/modules/cjs/loader.js:1138:30)
8:34:15 PM: at Object.Module._extensions…js (internal/modules/cjs/loader.js:1158:10)
8:34:15 PM: at Module.load (internal/modules/cjs/loader.js:986:32)
8:34:15 PM: at Function.Module._load (internal/modules/cjs/loader.js:879:14)
8:34:15 PM: at Module.require (internal/modules/cjs/loader.js:1026:19) {
8:34:15 PM: code: ‘MODULE_NOT_FOUND’,
8:34:15 PM: requireStack: [
8:34:15 PM: ‘/opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/loggers/yurnalist/index.js’,
8:34:15 PM: ‘/opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/start-logger.js’,
8:34:15 PM: ‘/opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/reporter/index.js’,
8:34:15 PM: ‘/opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/create-cli.js’,
8:34:15 PM: ‘/opt/build/repo/node_modules/gatsby/node_modules/gatsby-cli/lib/index.js’,
8:34:15 PM: ‘/opt/build/repo/node_modules/gatsby/dist/bin/gatsby.js’
8:34:15 PM: ]
8:34:15 PM: }
8:34:15 PM: ​
8:34:15 PM: ────────────────────────────────────────────────────────────────
8:34:15 PM: “build.command” failed
8:34:15 PM: ────────────────────────────────────────────────────────────────
8:34:15 PM: ​
8:34:15 PM: Error message
8:34:15 PM: Command failed with exit code 1: gatsby build
8:34:15 PM: ​
8:34:15 PM: Error location
8:34:15 PM: In Build command from Netlify app:
8:34:15 PM: gatsby build
8:34:15 PM: ​
8:34:15 PM: Resolved config
8:34:15 PM: build:
8:34:15 PM: command: gatsby build
8:34:15 PM: commandOrigin: ui
8:34:15 PM: publish: /opt/build/repo/public
8:34:15 PM: Caching artifacts
8:34:15 PM: Started saving node modules
8:34:15 PM: Finished saving node modules
8:34:15 PM: Started saving build plugins
8:34:15 PM: Finished saving build plugins
8:34:15 PM: Started saving pip cache
8:34:15 PM: Finished saving pip cache
8:34:15 PM: Started saving emacs cask dependencies
8:34:15 PM: Finished saving emacs cask dependencies
8:34:15 PM: Started saving maven dependencies
8:34:15 PM: Finished saving maven dependencies
8:34:15 PM: Started saving boot dependencies
8:34:15 PM: Finished saving boot dependencies
8:34:15 PM: Started saving rust rustup cache
8:34:15 PM: Finished saving rust rustup cache
8:34:15 PM: Started saving go dependencies
8:34:15 PM: Finished saving go dependencies
8:34:18 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
8:34:18 PM: Failing build: Failed to build site
8:34:18 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
8:34:19 PM: Finished processing build request in 1m52.66753848s

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:

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!

5:18:31 PM: Build ready to start
help :sweat_smile:
5:18:33 PM: build-image version: d84c79427e8f83c1ba17bcdd7b3fe38059376b68
5:18:33 PM: build-image tag: v3.6.1
5:18:33 PM: buildbot version: d8e1c13dfa09a710800c3bc5ceee4ff2d6548477
5:18:33 PM: Fetching cached dependencies
5:18:33 PM: Failed to fetch cache, continuing with build
5:18:33 PM: Starting to prepare the repo for build
5:18:33 PM: No cached dependencies found. Cloning fresh repo
5:18:33 PM: git clone GitHub - qusai9898/sm
5:18:34 PM: Preparing Git Reference refs/heads/gh-pages
5:18:35 PM: Different publish path detected, going to use the one specified in the Netlify configuration file: ‘build’ versus ‘build/’ in the Netlify UI
5:18:36 PM: Starting build script
5:18:36 PM: Installing dependencies
5:18:36 PM: Python version set to 2.7
5:18:37 PM: v12.18.0 is already installed.
5:18:37 PM: Now using node v12.18.0 (npm v6.14.4)
5:18:38 PM: Started restoring cached build plugins
5:18:38 PM: Finished restoring cached build plugins
5:18:38 PM: Attempting ruby version 2.7.1, read from environment
5:18:39 PM: Using ruby version 2.7.1
5:18:39 PM: Using PHP version 5.6
5:18:39 PM: Started restoring cached go cache
5:18:39 PM: Finished restoring cached go cache
5:18:39 PM: go version go1.14.4 linux/amd64
5:18:40 PM: go version go1.14.4 linux/amd64
5:18:40 PM: Installing missing commands
5:18:40 PM: Verify run directory
5:18:41 PM: ​
5:18:41 PM: ────────────────────────────────────────────────────────────────
5:18:41 PM: Netlify Build
5:18:41 PM: ────────────────────────────────────────────────────────────────
5:18:41 PM: ​
5:18:41 PM: ❯ Version
5:18:41 PM: @netlify/build 9.8.6
5:18:41 PM: ​
5:18:41 PM: ❯ Flags
5:18:41 PM: deployId: 6048e3472a743c009be67471
5:18:41 PM: mode: buildbot
5:18:41 PM: ​
5:18:41 PM: ❯ Current directory
5:18:41 PM: /opt/build/repo
5:18:41 PM: ​
5:18:41 PM: ❯ Config file
5:18:41 PM: No config file was defined: using default values.
5:18:41 PM: ​
5:18:41 PM: ❯ Context
5:18:41 PM: production
5:18:41 PM: ​
5:18:41 PM: ────────────────────────────────────────────────────────────────
5:18:41 PM: 1. Build command from Netlify app
5:18:41 PM: ────────────────────────────────────────────────────────────────
5:18:41 PM: ​
5:18:41 PM: $ npm run build
5:18:42 PM: npm ERR! code ENOENT
5:18:42 PM: npm ERR! syscall open
5:18:42 PM: npm ERR! path /opt/build/repo/package.json
5:18:42 PM: npm ERR! errno -2
5:18:42 PM: npm ERR! enoent ENOENT: no such file or directory, open ‘/opt/build/repo/package.json’
5:18:42 PM: npm ERR! enoent This is related to npm not being able to find a file.
5:18:42 PM: npm ERR! enoent
5:18:42 PM: npm ERR! A complete log of this run can be found in:
5:18:42 PM: npm ERR! /opt/buildhome/.npm/_logs/2021-03-10T15_18_42_140Z-debug.log
5:18:42 PM: ​
5:18:42 PM: ────────────────────────────────────────────────────────────────
5:18:42 PM: “build.command” failed
5:18:42 PM: ────────────────────────────────────────────────────────────────
5:18:42 PM: ​
5:18:42 PM: Error message
5:18:42 PM: Command failed with exit code 254: npm run build
5:18:42 PM: ​
5:18:42 PM: Error location
5:18:42 PM: In Build command from Netlify app:
5:18:42 PM: npm run build
5:18:42 PM: ​
5:18:42 PM: Resolved config
5:18:42 PM: build:
5:18:42 PM: command: npm run build
5:18:42 PM: commandOrigin: ui
5:18:42 PM: publish: /opt/build/repo/build
5:18:42 PM: Caching artifacts
5:18:42 PM: Started saving build plugins
5:18:42 PM: Finished saving build plugins
5:18:42 PM: Started saving pip cache
5:18:42 PM: Finished saving pip cache
5:18:42 PM: Started saving emacs cask dependencies
5:18:42 PM: Finished saving emacs cask dependencies
5:18:42 PM: Started saving maven dependencies
5:18:42 PM: Finished saving maven dependencies
5:18:42 PM: Started saving boot dependencies
5:18:42 PM: Finished saving boot dependencies
5:18:42 PM: Started saving rust rustup cache
5:18:42 PM: Finished saving rust rustup cache
5:18:42 PM: Started saving go dependencies
5:18:42 PM: Finished saving go dependencies
5:18:45 PM: Build failed due to a user error: Build script returned non-zero exit code: 2
5:18:45 PM: Failing build: Failed to build site
5:18:45 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 2
5:18:45 PM: Finished processing build request in 12.662780592s

you probably need a package.json file :slight_smile:

This Support Guide contains a ton of useful debugging tips that can likely help you solve your problem :slight_smile:

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!

build.command” failed

how to solve this problem?

My package.json file:-
{

“name”: “personal_site”,

“version”: “0.1.0”,

“private”: true,

“scripts”: {

"dev": "next dev",

"build": "next build",

"start": "next start"

},

“dependencies”: {

"@zeit/next-css": "^1.0.1",

"bootstrap": "^4.6.0",

"next": "^10.2.3",

"react": "^17.0.2",

"react-bootstrap": "^1.6.1",

"react-dom": "^17.0.2",

"react-icons": "^4.2.0",

"styled-components": "^5.3.0",

"styled-normalize": "^8.0.7"

}

}

Hi zahidhasann, glad you found us :wave: before we can help you, we need a little more information on the issues you are facing.

Please tell us:

  • the name of your build instance: “example-jones.netlify.com
  • what you have already tried
  • any error messages you have received in your terminal window or in the developer console

Thank you.

  1. zahidh.netlify.app
  2. Yes, I have been trying for the last 2 days but still didn’t solve this problem.
    3.No didn’t get any errors.

Hi @zahidhasann,

It seems like that website doesn’t exist? Could you recheck the URL?