Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What should I do with peer dependencies of dependencies when I develop a library?

Here the situation :
I work on a library that has dependencies which themselves have peer-dependencies.

When doing a pnpm install, of course I have an error because of unresolved peer-dependencies.

Also, the library does not use these peer-dependencies.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What should I do ? use .npmrc to auto-install them ? forward them as peer-dependency ?
another thing ?

(Note : the library was initially using npm)

>Solution :

I guess just use auto-install-peers=true in your .npmrc. This setting will be true by default from pnpm v8.

Alternatively, you may install the missing peer dependencies as dev dependencies of you package.

There is no need to add them to peer dependencies unless you use them in code.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading