"Gridsome build" fails when trying to deploy

Hi all, please help me resolve this ongoing issue. I’m new to the Gridsome world and I’m trying to deploy a starter site. However, the “gridsome build” command is failing each time I try to deploy.

12:32:03 PM: Build ready to start
12:32:05 PM: build-image version: 6dfe19d15f524c85d6f9bf7df9fb30b0a9f0a61a
12:32:05 PM: build-image tag: v3.3.10
12:32:05 PM: buildbot version: 0d19834c19ebfe54208907d729718495339fe085
12:32:06 PM: Fetching cached dependencies
12:32:06 PM: Failed to fetch cache, continuing with build
12:32:06 PM: Starting to prepare the repo for build
12:32:06 PM: No cached dependencies found. Cloning fresh repo
12:32:06 PM: git clone https://github.com/mr-spacklefish/gridsome-new
12:32:07 PM: Preparing Git Reference refs/heads/master
12:32:07 PM: Starting build script
12:32:07 PM: Installing dependencies
12:32:09 PM: v10.20.1 is already installed.
12:32:09 PM: Now using node v10.20.1 (npm v6.14.4)
12:32:10 PM: Attempting ruby version 2.6.2, read from environment
12:32:11 PM: Using ruby version 2.6.2
12:32:11 PM: Using PHP version 5.6
12:32:11 PM: 5.2 is already installed.
12:32:11 PM: Using Swift version 5.2
12:32:11 PM: Started restoring cached go cache
12:32:11 PM: Finished restoring cached go cache
12:32:11 PM: go version go1.12 linux/amd64
12:32:11 PM: go version go1.12 linux/amd64
12:32:11 PM: Installing missing commands
12:32:11 PM: Verify run directory
12:32:11 PM: Executing user command: gridsome build
12:32:11 PM: /usr/local/bin/build: line 46: gridsome: command not found
12:32:11 PM: Skipping functions preparation step: no functions directory set
12:32:11 PM: Caching artifacts
12:32:11 PM: Started saving pip cache
12:32:11 PM: Finished saving pip cache
12:32:11 PM: Started saving emacs cask dependencies
12:32:11 PM: Finished saving emacs cask dependencies
12:32:11 PM: Started saving maven dependencies
12:32:11 PM: Finished saving maven dependencies
12:32:11 PM: Started saving boot dependencies
12:32:12 PM: Finished saving boot dependencies
12:32:12 PM: Started saving go dependencies
12:32:12 PM: Finished saving go dependencies
12:32:15 PM: Error running command: Build script returned non-zero exit code: 127
12:32:15 PM: Failing build: Failed to build site
12:32:15 PM: Failed during stage ‘building site’: Build script returned non-zero exit code: 127
12:32:15 PM: Finished processing build request in 10.042603447s

Also, the GitHub repo is https://github.com/mr-spacklefish/gridsome-new.git

Thanks again, I just want to be able to deploy a site and go from there.

  • Adam

howdy,

could you post a screenshot of your build settings and also your package.json please?

I don’t think that my build command is spitting out a json file. Do you need the package.json from my gridsome project?

yes, i would like to see your package.json so we can check and see if the commands are defined correctly there.

image

ok, your package.json config and your build commands match, but, i am not seeing your package.json in your repo? You’ll need to include that so that we know what to install and how to build.

Unless - are you deploying built html?

in that case just remove the build command from the build settings.

I think I might be transferring the build incorrectly to my repo. I’m not seeing the “normal” files after watching a couple of tutorials. I thought I just ran the “gridsome build” command and that creates a “dist” folder. I push that to my repo and walahhh. I guess I’m missing something here.

ok so you either:

  • include your src files (the stuff we build html from)
  • include a package json (at the site root in most cases)
  • include a correct build command in the Netlify UI (in your case gridsome build)
  • push the whole lot to github

and then we run the build process for you, generate the html, and push the html out to the CDN edge nodes

OR

  • you run your build (gridsome build) on local,
  • add the html files only to the repo,
  • dont include a package.json
  • push the repo
  • leave the build command blank

and the system detects you already have html files and pushes that our to our CDN nodes.

So the gridsome build process still has to happen, just the question is when/where, and the steps are different depending on how you want to set things up. It’s the difference between opening your umbrella inside and then needing it to carry it through the doorway, or waiting until you are outside and then opening it. A different process for both.

Does this help?

That helps a ton. I’ll try it again from scratch, both ways. Option B sounds much nicer because that is pretty much what is happening every time I run a new “gridsome build” command. Much appreciated. I’ll ping again if there is no resolve. Thanks.

1 Like

I went with the option to leave the build blank, it worked! I guess when I run the “gridsome build” command there are things happening behind the scenes. I might try to create a new repo and site to see if I can build/deploy with the src files, package.json, etc. Thanks again!

hooray! glad its working. Yeah, getting netlify do to the build + deploy step is exactly what makes our platform so powerful, so i recommend trying to investigate that and getting it to work on a separate site. the main point is to get your build settings (directories, and build command) to match up with your package.json and it should be smooth sailing. hit us up again if you get stuck :+1: