It’s not a private npm package, it’s a monorepo. All packages are in the same repository. I want to deploy the example packages, which uses the theme package.
I think the problem is, that the example package does not have a yarn.lock. Because lock files are stored in the root directory in monorepos. And because there is no lock file, netlify tries to build via npm instead of yarn.
In case of monorepos that use yarn workspace I guess using base is not what you want.
Our monorepo feature is built for repos that have their frontend in a subdirectory along with the yarn.lock
E.g. a Golang backend that has docs in /docs or a microservice architecture with the frontend in the same repo under /frontend
For these kinds of sites the base setting is crucial, because otherwise our buildbot can’t detect & cache dependencies.
You have several options:
Use e.g. yarn build as a build command which will run it in all packages, detecting dependencies correctly
Use yarn --cwd packages/package_to_deploy build for running a command from a specific package
Using something like yarn workspace example build in the base directory builds at least the site. But caching doesn’t work. So on every build netlify does a full yarn install. I think it’s because in example/node_modules/.bin there are some symbolic links to /node_modules/
Any update on this? I’m also trying to configure deployment pipeline for a monorepo using Yarn Workspaces where each package (other than one called shared) is a separate static site. But I only have one lockfile at the monorepo root so I’m unable to set things up.
No updates on this feature, no. I guess I don’t understand why your build fails exactly; it’s possible we can help you find a workaround (it wouldn’t be brilliant, but it could likely work). Regardless, as promised, we’ll post here if things change (or you can follow this issue: https://github.com/netlify/build-image/issues/196)
PR’s are welcome if you have a suggestion about how to better implement it though! This is likely the only file that would need changing: