Trouble adding a package to algolia-netlify

The Algolia-netlify one-click install is awesome. Kudos to the team for that.

Unfortunately, I need to make some modifications, including adding a package. After several attempts Windows and WSL and various permutations on npm and yarn, I’m stumped. I think I’ve pretty much convinced myself that I need to be using Yarn, because that’s how this package is set up. So I’ve cloned @tryghost/algolia and then run ‘yarn install’, no problems. But when I try yarn add pdf.js-extract or yarn add canvas, I get this error:

An unexpected error occurred: "expected workspace package to exist for \"sinon\"".

And that’s where I’m stumped.

Can someone give me a nudge in the right direction, or point out some docs I’m missing that might be helpful here? The ‘how to deploy algolia-netlify to netlify’ are unfortunately basically “click the button”, which isn’t helping with my problem. :(

Many thanks in advance!

Just in case anyone comes along later looking for a fix for this:

I spent several hours wrangling with lerna and yarn and workspaces and I don’t even know what else.

Finally, I started a brand new empty folder locally. I installed netlify-cli. I followed its directions to create an empty project, link it to github and netlify, and then I copied in the two netlify functions from the algolia-netlify repo. I needed to npm install @algolia-fragmenter and -indexer, plus the package I needed for the functionality I was adding. (Full text search of PDFs, baby!)

I had to manually set up environment variables, but it was far less painful than last night’s trip into dependency hell.

TL;DR version: algolia-netlify is awesome if you want one click deploy, but when I wanted to mod it, just grabbing the two functions and starting from zero was faster for me.