When i try to deploy the application I am getting this error. it is showing build script returned non-zero code: 1

3:11:01 PM: Build ready to start
3:11:03 PM: build-image version: 30f629161c0736b1a3ecd8b418e5eeffab5c0faf
3:11:03 PM: build-image tag: v3.3.14
3:11:03 PM: buildbot version: 960d989224ecbd0e01be03c5f7dffe3d8f543e02
3:11:03 PM: Fetching cached dependencies
3:11:03 PM: Failed to fetch cache, continuing with build
3:11:03 PM: Starting to prepare the repo for build
3:11:04 PM: No cached dependencies found. Cloning fresh repo
3:11:04 PM: git clone https://github.com/GeekRoot999/portfolio
3:11:04 PM: Preparing Git Reference refs/heads/master
3:11:06 PM: Starting build script
3:11:06 PM: Installing dependencies
3:11:07 PM: Downloading and installing node v10.21.0…
3:11:07 PM: Downloading https://nodejs.org/dist/v10.21.0/node-v10.21.0-linux-x64.tar.xz…
3:11:07 PM: Computing checksum with sha256sum
3:11:07 PM: Checksums matched!
3:11:10 PM: Now using node v10.21.0 (npm v6.14.4)
3:11:10 PM: Started restoring cached build plugins
3:11:10 PM: Finished restoring cached build plugins
3:11:10 PM: Attempting ruby version 2.6.2, read from environment
3:11:11 PM: Using ruby version 2.6.2
3:11:12 PM: Using PHP version 5.6
3:11:12 PM: 5.2 is already installed.
3:11:12 PM: Using Swift version 5.2
3:11:12 PM: Started restoring cached node modules
3:11:12 PM: Finished restoring cached node modules
3:11:12 PM: Installing NPM modules using NPM version 6.14.4
3:11:24 PM: > node-sass@4.14.1 install /opt/build/repo/node_modules/node-sass
3:11:24 PM: > node scripts/install.js
3:11:25 PM: Downloading binary from https://github.com/sass/node-sass/releases/download/v4.14.1/linux-x64-64_binding.node
3:11:25 PM: Download complete
3:11:25 PM: Binary saved to /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
3:11:25 PM: Caching binary to /opt/buildhome/.npm/node-sass/4.14.1/linux-x64-64_binding.node
3:11:26 PM: > node-sass@4.14.1 postinstall /opt/build/repo/node_modules/node-sass
3:11:26 PM: > node scripts/build.js
3:11:26 PM: Binary found at /opt/build/repo/node_modules/node-sass/vendor/linux-x64-64/binding.node
3:11:26 PM: Testing binary
3:11:26 PM: Binary is fine
3:11:27 PM: npm
3:11:27 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/webpack-dev-server/node_modules/fsevents):
3:11:27 PM: npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
3:11:27 PM: npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/watchpack-chokidar2/node_modules/fsevents):
3:11:27 PM: npm
3:11:27 PM: WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
3:11:27 PM: npm
3:11:27 PM: WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/fsevents):
3:11:27 PM: npm WARN
3:11:27 PM: notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {β€œos”:β€œdarwin”,β€œarch”:β€œany”} (current: {β€œos”:β€œlinux”,β€œarch”:β€œx64”})
3:11:27 PM: added 1000 packages from 536 contributors and audited 1003 packages in 13.963s
3:11:27 PM: 36 packages are looking for funding
3:11:27 PM: run npm fund for details
3:11:27 PM: found 0 vulnerabilities
3:11:27 PM: NPM modules installed
3:11:27 PM: Started restoring cached go cache
3:11:27 PM: Finished restoring cached go cache
3:11:27 PM: go version go1.12 linux/amd64
3:11:27 PM: go version go1.12 linux/amd64
3:11:27 PM: Installing missing commands
3:11:27 PM: Verify run directory
3:11:29 PM: ​
3:11:29 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
3:11:29 PM: β”‚ Netlify Build β”‚
3:11:29 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3:11:29 PM: ​
3:11:29 PM: ❯ Version
3:11:29 PM: @netlify/build 1.0.14
3:11:29 PM: ​
3:11:29 PM: ❯ Flags
3:11:29 PM: mode: buildbot
3:11:29 PM: ​
3:11:29 PM: ❯ Current directory
3:11:29 PM: /opt/build/repo
3:11:29 PM: ​
3:11:29 PM: ❯ Config file
3:11:29 PM: No config file was defined: using default values.
3:11:29 PM: ​
3:11:29 PM: ❯ Context
3:11:29 PM: production
3:11:29 PM: ​
3:11:29 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
3:11:29 PM: β”‚ 1. Build command from settings β”‚
3:11:29 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3:11:29 PM: ​
3:11:29 PM: $ npm run build
3:11:29 PM: > portfolio@1.0.1 build /opt/build/repo
3:11:29 PM: > webpack --config webpack.prod.js
3:11:31 PM: Insufficient number of arguments or no entry found.
3:11:31 PM: Alternatively, run β€˜webpack(-cli) --help’ for usage info.
3:11:31 PM: Hash: c97f842da7149f7a2076
3:11:31 PM: Version: webpack 4.43.0
3:11:31 PM: Time: 119ms
3:11:31 PM: Built at: 06/05/2020 9:41:31 AM
3:11:31 PM: ERROR in Entry module not found: Error: Can’t resolve β€˜./src/index.js’ in β€˜/opt/build/repo’
3:11:31 PM: ERROR in Entry module not found: Error: Can’t resolve β€˜./src/vendor.js’ in β€˜/opt/build/repo’
3:11:31 PM: ERROR in Error: Child compilation failed:
3:11:31 PM: Entry module not found: Error: Can’t resolve β€˜/opt/build/repo/src/template.htm l’ in β€˜/opt/build/repo’:
3:11:31 PM: Error: Can’t resolve β€˜/opt/build/repo/src/template.html’ in β€˜/opt/build/repo’
3:11:31 PM: - compiler.js:79 childCompiler.runAsChild
3:11:31 PM: [repo]/[html-webpack-plugin]/lib/compiler.js:79:16
3:11:31 PM: - Compiler.js:343 compile
3:11:31 PM: [repo]/[webpack]/lib/Compiler.js:343:11
3:11:31 PM: - Compiler.js:681 hooks.afterCompile.callAsync.err
3:11:31 PM: [repo]/[webpack]/lib/Compiler.js:681:15
3:11:31 PM: - Hook.js:154 AsyncSeriesHook.lazyCompileHook
3:11:31 PM: [repo]/[tapable]/lib/Hook.js:154:20
3:11:31 PM: - Compiler.js:678 compilation.seal.err
3:11:31 PM: [repo]/[webpack]/lib/Compiler.js:678:31
3:11:31 PM: - Hook.js:154 AsyncSeriesHook.lazyCompileHook
3:11:31 PM: [repo]/[tapable]/lib/Hook.js:154:20
3:11:31 PM: - Compilation.js:1423 hooks.optimizeAssets.callAsync.err
3:11:31 PM: [repo]/[webpack]/lib/Compilation.js:1423:35
3:11:31 PM: - Hook.js:154 AsyncSeriesHook.lazyCompileHook
3:11:31 PM: [repo]/[tapable]/lib/Hook.js:154:20
3:11:31 PM: - Compilation.js:1414 hooks.optimizeChunkAssets.callAsync.err
3:11:31 PM: [repo]/[webpack]/lib/Compilation.js:1414:32
3:11:31 PM: - index.js:321 taskRunner.run
3:11:31 PM: [repo]/[terser-webpack-plugin]/dist/index.js:321:9
3:11:31 PM: - TaskRunner.js:48 TaskRunner.run
3:11:31 PM: [repo]/[terser-webpack-plugin]/dist/TaskRunner.js:48:7
3:11:31 PM: - index.js:227 TerserPlugin.optimizeFn
3:11:31 PM: [repo]/[terser-webpack-plugin]/dist/index.js:227:18
3:11:31 PM: - next_tick.js:68 process._tickCallback
3:11:31 PM: internal/process/next_tick.js:68:7
3:11:31 PM:
3:11:31 PM: Child html-webpack-plugin for β€œindex.html”:
3:11:31 PM: ERROR in Entry module not found: Error: Can’t resolve β€˜/opt/build/repo/src/template.html’ in β€˜/opt/build/repo’
3:11:31 PM: npm
3:11:31 PM: ERR! code ELIFECYCLE
3:11:31 PM: npm
3:11:31 PM: ERR! errno 2
3:11:31 PM: npm
3:11:31 PM: ERR! portfolio@1.0.1 build: webpack --config webpack.prod.js
3:11:31 PM: npm
3:11:31 PM: ERR! Exit status 2
3:11:31 PM: npm
3:11:31 PM: ERR!
3:11:31 PM: npm
3:11:31 PM: ERR! Failed at the portfolio@1.0.1 build script.
3:11:31 PM: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
3:11:31 PM: npm
3:11:31 PM: ERR! A complete log of this run can be found in:
3:11:31 PM: npm ERR! /opt/buildhome/.npm/_logs/2020-06-05T09_41_31_287Z-debug.log
3:11:31 PM: ​
3:11:31 PM: β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
3:11:31 PM: β”‚ β€œbuild.command” failed β”‚
3:11:31 PM: β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
3:11:31 PM: ​
3:11:31 PM: Error message
3:11:31 PM: Command failed with exit code 2: npm run build
3:11:31 PM: ​
3:11:31 PM: Error location
3:11:31 PM: In Build command from settings:
3:11:31 PM: npm run build
3:11:31 PM: ​
3:11:31 PM: Resolved config
3:11:31 PM: build:
3:11:31 PM: command: npm run build
3:11:31 PM: publish: /opt/build/repo/dist
3:11:31 PM: Caching artifacts
3:11:31 PM: Started saving node modules
3:11:31 PM: Finished saving node modules
3:11:31 PM: Started saving build plugins
3:11:31 PM: Finished saving build plugins
3:11:31 PM: Started saving pip cache
3:11:31 PM: Finished saving pip cache
3:11:31 PM: Started saving emacs cask dependencies
3:11:31 PM: Finished saving emacs cask dependencies
3:11:31 PM: Started saving maven dependencies
3:11:31 PM: Finished saving maven dependencies
3:11:31 PM: Started saving boot dependencies
3:11:31 PM: Finished saving boot dependencies
3:11:31 PM: Started saving go dependencies
3:11:31 PM: Finished saving go dependencies
3:11:35 PM: Error running command: Build script returned non-zero exit code: 1
3:11:35 PM: Failing build: Failed to build site
3:11:35 PM: Failed during stage β€˜building site’: Build script returned non-zero exit code: 1
3:11:35 PM: Finished processing build request in 31.641266965s

hi there, i have moved this post as this isn’t related to build plugins specifically.

first question - does this run locally? I think you have a config error and also clearly some issues with some of your files:

3:11:31 PM: Entry module not found: Error: Can’t resolve β€˜/opt/build/repo/src/template.htm l’ in β€˜/opt/build/repo’:

do you see how there is a space in html? not sure how that got there.

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

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!

Hi @perry thanks for the help. And yeah I fixed the error and hosted it but forgot to close the issue . Thanks again for the help.

1 Like