Issue with npm peer dependencies in locally linked packages

I’m having difficulties dealing with peer dependencies in locally linked packages. I have some code which works just fine with a dependency on a package that is hosted remotely by npmjs but fails when that package is accessed via a “file:” link in my package.json file.

For more details, my code has plain dependencies on Package X and Package Y. Package X has a peer dependency on Package Y. When Package X is published to npmjs and installed from there (rather than installed via a local link) I ended up with just the single version of Package Y that was shared between the test program and the plugin, as was desired. However, when the dependency on Package X is changed to a local (i.e. “file:”) link I end up with two versions of Package Y, which is not desired.

I’ll add that my code uses webpack, which might complicate the issue.

Thanks for any help!