Gatsby build is not found

I need advice to debug deploy

Apparently “gatsby build” needs to be setup as an environment variable, but I am unclear on where to do that. (Sorry, I’m new here!)

hi there, welcome.

question 1: does your app build/run locally OK?
question 2: did you work through this post? It covers a lot of the common stuff.

let us know if you fix it or not, and we can troubleshoot a little more. :+1:

1 Like

Thank you so much, Perry! I fixed the issue. I am using gatsby and needed to change the build command to “npm run build” instead of “gatsby build”. Also I think I provided the base directory to match my git repo name instead of leaving it blank.

I did some searches and found another post that indicated, from the deploy log, that the build command, in my case “gatsby build”, could not be found. So I read up on the gatsbyjs docs side and it said that for netlify the appropriate build command is “npm run build”, instead of “gatsby build”.

1 Like

fab! glad its fixed!

I had an issue where I set an environment variable for npm version incorrectly. I fixed that but still have build failure. Now there’s an issue with gatsby image sharp plugin. I have run npm update to hopefully have a fix, and am testing that in the netlify build now.

Actually, to be clear, the log mssg indicated I should delete the node_module for the sharp and run ‘npm install’ again. I deleted the entire node_modules dir and ran ‘npm install’…

And committed that to my git repo, which uploaded that and ran another deploy with the fresh package.

Ok, now the original issue is back - which is that the deploy log seems to show the mdx frontmatter endlessly streaming through the log, like it’s in an endless loop or something. I used MDX to enter in my “content” which is metadata about artwork. Each artwork page also has a ‘navlist’ component which is a list of links to all 167 other artwork pages (which use the mdx frontmatter to compile data).

The netlify best practices indicate that large media (images) would be better hosted by something like cloudinary.

I also noticed that the deploy log has 88,000+ lines and seems to be timing out. I think the last deploy too 40+ minutes before failing. What could induce these “loopy” build behaviors?

The site is basically just 170 pages with large art images and each page has a link list to every other page. Could that cause this huge build “loop” somehow?

Hi Perry, can I get another look at my deploy failures?


hi dean, I followed up on the other thread for clarity’s sake. Gonna close this one.