Force installing local packages from registry with yarn workspaces


I’ve got a monorepo that uses Lerna, Yarn workspaces and Netlify in conjunction. I’ve got 5 sites hosted in total on Netlify, based on this repo, as an example, one of these is homecheck
A few of my packages depend on other local packages, and running lerna bootstrap while using Yarn workspaces works great as all local packages get symlinked.

Builds on Netlify are also working as could be expected, as I put empty yarn.lock files in every repo to force Netlify to use yarn for installing instead of npm

However, I would want yarn to not symlink my local packages during the build process on Netlify and rather download these from a private Github registry, where all of my packages get published before every push.

Is such a thing possible?
I’d imagine I would need to pass a custom install command to Netlify to be able to do this, or am I missing something here?

Hiya @Robin-Hoodie and sorry to be slow to get back to you!

The answer to that depends - how do you install those packages when working locally? (I’m not looking for authentication tokens, just a general workflow that you might use if you got a new local development machine, and had to start from scratch. Perhaps something like : “I use git clone” or “I use a private npm server which I connect to with a specified $NPM_TOKEN”?)

Hi @fool,

I install those packages locally using yarn workspaces, where yarn will create symlinks between the packages with yarn link.

Yea, not sure how you would accomplish what you described. We run ‘yarn install’ and I assume that the linking is the default behavior for you project. Perhaps you could run your custom install command as part of your build command to override the symlinked packages. Would that work for you?

@Dennis That feels quite hacky to be honest. I’ve worked around the issue now, so I don’t really need to solve this anymore.

Thanks looking into this though!