Unlock seamless workflows and faster delivery with our latest releases- get the details

GatsbyCloud users report issues with Lerna in multi-package repositories

7 replies
Last updated: May 12, 2023
This is a GatsbyCloud + Lerna question, but before creating a GitHub issue I thought I’d ask.
Builds on GC fail since a week ago. Believe it’s not honoring the base directory site setting. It works fine on Netlify and locally.

My guess is GC isn’t looking out for the multi-package repo scenario, and a change on their end broke that ability?


ERROR Failed to compile: Error: Command failed with ENOENT: lerna bootstrap --registry=<https://registry.npmjs.org/>
spawn lerna ENOENT
Apr 11, 2023, 7:01 PM
Hey. That should help -&gt; https://www.reddit.com/r/gatsbyjs/comments/11rr2l5/error_failed_to_compile_error_lerna_bootstrap/ TL;DR GC don’t like lerna anymore ^^
Apr 13, 2023, 10:38 AM
Thanks. I did look at that. Their solution was just: stop using Lerna, delete the package.json 😂
Apr 13, 2023, 5:53 PM
I put in a support ticket to push GatsbyCloud to start supporting monorepos again, since they claim to.
Apr 13, 2023, 5:54 PM
If you’re not in a hurry, hopefully you’ll manage to find a solution.I had the same issue and lost so much time because of this ... On the bright side I found out that I wasn’t needing Lerna as much as I thought to
😂 😂 😂That being said it appears from nowhere and don’t even seem to be documented ...
Good luck!
Apr 14, 2023, 7:18 AM
Fair. My pain isn’t immediate, I use Netlify for actual hosting and GatsbyCloud just for previews… only content authors are suffering at the moment. Lerna is more of a nice to have, but I’m trying to keep it.
Looks like more Reddit activity about this problem…

https://www.reddit.com/r/gatsbyjs/comments/12lsji0/lerna_sudden_build_fails/
Apr 14, 2023, 6:38 PM
GatsbyCloud has fixed this issue!
Apr 22, 2023, 8:45 AM
We had a lot of issues when moving from 1.0 to Learna 3 and are now using Learna 6.4.1. I am glad you were able to fix it. We found Netlify worked when Gatsby Cloud did not. We also found Learna had issues adding node modules to the web folder and we had to add them manually to make things work. This is how we structured and it works great on both Gatsby Cloud and Netlify now.
Here are some great additional resources for you too.
* [Publish Multiple Gatsby Sites in a Monorepo, Using Lerna, Travis &amp; Vercel](
https://www.gatsbyjs.com/blog/2019-01-01-publish-multiple-gatsby-sites/ )* [Building a JavaScript Monorepo with Lerna](
https://javascript.plainenglish.io/javascript-monorepo-with-lerna-5729d6242302 )* [@lerna/bootstrap](
https://www.npmjs.com/package/@lerna/bootstrap )* [Lerna Getting Started](
https://lerna.js.org/docs/getting-started )
May 12, 2023, 1:32 AM

Sanity– build remarkable experiences at scale

Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.

Was this answer helpful?