Search code examples
node.jsyarnpkgmonorepo

How to bump version in all the packages when using yarn workspaces?


When using Yarn Workspaces, we have a project structure like:

- package.json
- packages/
    - package-a/
        - package.json
        - index.js
    - package-b/
        - package.json
        - index.js

If package-b and lots of other packages in this directory are dependent upon package-a and I upgrade the version of package-a after making some changes, How can I upgrade the version package-a in all the dependent packages? Do I have to do it manually or is there a better way?


Solution

  • I believe the other answer is outdated; now with yarn workspaces you can use yarn up <library-name> to bump your dependency in all your workspaces.