Search code examples
reactjsnpmyarnpkglerna

Yarn workspaces and yarn link


I have a workspaces project like so:

/project
  - package.json
    /packages
       /project-a
          package.json
       /project-b
          package.json

project-b depends on project-a. Inside workspaces everything is running fine. Now I want to use project-b inside another (new) npm project. Normally yarn link would work, but because of the dependency on project-a this will not work. Is there a correct way to do this?

I've tried yalc and publising to npm which both work, but I like to know if there's an alternate lerna/yarn/npm solution I am not aware of.


Solution

  • I am using verdaccio for this now; https://github.com/verdaccio/verdaccio Verdaccio allows to create a local npm registry.