0

Let's assume I have a project structure as follows:

packages/
     core/
     client1/
     client2/
package.json

All the subpackages are supposed to be published to a public registry, but haven't been published yet. Client packages link core package as a local dependency (defined as file:../core in their package.json files). Npm documentation suggests using such dependencies locally, which seems logical enough. But is it possible to install a package from local dependency in one case and from registry in another case, and what's the correct way to handle this in JS world?

tk421
  • 5,775
  • 6
  • 23
  • 34
  • Yarn workspaces could be smth you're looking for: https://yarnpkg.com/lang/en/docs/workspaces/. Afaik there's no alternative for npm. – Clarity Sep 17 '19 at 15:26
  • Does this answer your question? [how to specify local modules as npm package dependencies](https://stackoverflow.com/questions/15806241/how-to-specify-local-modules-as-npm-package-dependencies) – Inigo May 22 '20 at 17:13

0 Answers0