1

I've published a private package to a URL as a tarball and am consuming it in another package, but when I install it it is installing things it shouldn't (in my opinion).

My private package's package.json looks like this in dependencies:

    "lodash": "^4.17.15",
    "rxjs": "^6.3.3",

The package that is consuming it looks like this:

    "lodash": "^4.17.10",
    "rxjs": "^6.5.3"

Yet when my private package is installed with yarn it creates its own node_modules folder and installs rxjs and lodash, despite the package it is installed in already having packages that, to my understanding, fulfill its requirements.

  1. Am I not declaring the dependencies correctly in my private package (or the package that consumes it?)
  2. Does this have something to do with the nature of the private package - it's just a tarball containing a build folder and a package.json?
jonrsharpe
  • 115,751
  • 26
  • 228
  • 437
Adam Jenkins
  • 51,445
  • 11
  • 72
  • 100
  • 1
    That's what's supposed to happen. If you expect this package to be installed in projects that already declare those dependencies, make them `peerDependencies`. – jonrsharpe Sep 20 '19 at 12:46

0 Answers0