I'm encountering a problem with yarn workspaces, here is my situation :
I have a monorepo that contains :
In one of my apps, I'm trying to install a package from my packages folder that is published in npm, but when I do yarn install
, it keeps using the workspace folder and doesn't download the npm package nor updates the yarn lock.
How can I tell yarn to not use the workspace folder for install but download it from the remote? I'm using the workspaces only for local builds.
If you are using yarn berry, it looks up the package in your workspace first and remote registry after. This behavior can be changed by setting enableTransparentWorkspaces: false
in your .yarnrc.yml
file at root.
// .yarnrc.yml
enableTransparentWorkspaces: false
...
If you want to get a package from your workspace with the above option is set, you should explicitly add workspace:
protocol as a prefix for your package name in your package.json
.
"my-package": "workspace:^2.0.17",
See more at:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With