Hugo site working in local build but not in netlify

I am building a static site using Hugo, netlify, and github. But I am getting the error on the last line with exit code 127 about the building site script. What is this script and how do i fix this. LINK -[Github repo]
(https://github.com/dsaharia/dsaharia.com/tree/master) I am a very beginner.
The local build of the site works although a little different than actual theme.
The URL says page not found.
Thanks in advance

5:10:09 PM: Build ready to start
5:10:10 PM: build-image version: 42bca793ccd33055023c56c4ca8510463a56d317
5:10:10 PM: buildbot version: 15854c92f1b74f9c77ad951b5536193c76eff25e
5:10:11 PM: Fetching cached dependencies
5:10:11 PM: Starting to download cache of 16.7MB
5:10:11 PM: Finished downloading cache in 209.623278ms
5:10:11 PM: Starting to extract cache
5:10:11 PM: Finished extracting cache in 184.94328ms
5:10:11 PM: Finished fetching cache in 452.033931ms
5:10:11 PM: Starting to prepare the repo for build
5:10:11 PM: Preparing Git Reference refs/heads/master
5:10:12 PM: Starting build script
5:10:12 PM: Installing dependencies
5:10:13 PM: Downloading and installing node v8.12.0...
5:10:13 PM: Downloading https://nodejs.org/dist/v8.12.0/node-v8.12.0-linux-x64.tar.xz...
5:10:14 PM:   0.9%
5:10:14 PM: 
#####################
5:10:14 PM:                                                     30.3%
5:10:14 PM: 
#################################
5:10:14 PM: ####################################### 100.0%
5:10:14 PM: Computing checksum with sha256sum
5:10:14 PM: Checksums matched!
5:10:16 PM: Now using node v8.12.0 (npm v6.4.1)
5:10:17 PM: Attempting ruby version 2.3.6, read from environment
5:10:18 PM: Using ruby version 2.3.6
5:10:18 PM: Using PHP version 5.6
5:10:18 PM: Installing Hugo 0.41
5:10:19 PM: Started restoring cached go cache
5:10:19 PM: Finished restoring cached go cache
5:10:19 PM: unset GOOS;
5:10:19 PM: unset GOARCH;
5:10:19 PM: export GOROOT='/opt/buildhome/.gimme/versions/go1.10.linux.amd64';
5:10:19 PM: export PATH="/opt/buildhome/.gimme/versions/go1.10.linux.amd64/bin:${PATH}";
5:10:19 PM: go version >&2;
5:10:20 PM: export GIMME_ENV='/opt/buildhome/.gimme/env/go1.10.linux.amd64.env';
5:10:20 PM: go version go1.10 linux/amd64
5:10:20 PM: Installing missing commands
5:10:20 PM: Verify run directory
5:10:20 PM: Executing user command: hugo_0.41
5:10:20 PM: /usr/local/bin/build: line 32: hugo_0.41: command not found
5:10:20 PM: Caching artifacts
5:10:20 PM: Started saving pip cache
5:10:20 PM: Finished saving pip cache
5:10:20 PM: Started saving emacs cask dependencies
5:10:20 PM: Finished saving emacs cask dependencies
5:10:20 PM: Started saving maven dependencies
5:10:20 PM: Finished saving maven dependencies
5:10:20 PM: Started saving boot dependencies
5:10:20 PM: Finished saving boot dependencies
5:10:20 PM: Started saving go dependencies
5:10:20 PM: Finished saving go dependencies
5:10:20 PM: Cached node version v8.12.0
5:10:20 PM: Error running command: Build script returned non-zero exit code: 127
5:10:20 PM: Failing build: Failed to build site
5:10:20 PM: failed during stage 'building site': Build script returned non-zero exit code: 127
5:10:20 PM: Finished processing build request in 9.957599589s

Are you using a custom build script?

Also, see the hugo docs on hosting with Netlify

Take note of the netlify.toml file they mention.

1 Like

Also I see you are using hugo version 0.41. If you want a newer version, you need to specify that in your Netlify config file or a Netlify environment variable.

1 Like

Also, this may be your issue. Looks like you specified your build command to be:

hugo_0.41

Instead of:

hugo

This worked. Thank You very much. :slight_smile:
I have a doubt…
why is my local build slightly different than netlify hosted site.