Sitelet https://github.com/lerna/lerna/issues/501
Skip to content

[question] Using yarn commands with non-published lerna dependencies #501

Description

@timoxley

Is it possible to use npm/yarn with lerna if you've got packages which are not published to any registry?

e.g.

  • ./packages/A depends on B, found in ./packages/B.
  • B exists solely for code sharing, is just an internal package.
  • edit: No intention to publish either A nor B to any registry.

Currently, if you run any yarn command in ./packages/A e.g. yarn remove express the command will fail because yarn looks for B and B isn't published in any registry, thus error Couldn't find package "B" on the "npm" registry.

Is there a way around this? A way to specify lerna dependencies outside of "dependencies" perhaps? Maybe I missed something in the instructions. Perhaps this use-case just isn't supported.

edit: this seems like a yarn shortcoming really.

At the moment my workaround is terrible; I'm manually removing all lerna managed dependencies from package.json just prior to running commands like yarn add, then adding them back afterwards. This is truly not great.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions