vbuch / node-signpdf

Simple signing of PDFs in node.
MIT License
730 stars 178 forks source link

Could not resolve dependency with pdfkit@0.15.0 #243

Open Ryxuu opened 7 months ago

Ryxuu commented 7 months ago

Describe the bug and the expected behaviour I am using pdfkit@0.15.0. When I try to istall @signpdf/placeholder-pdfkit the installation process fails with

npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: project1A@1.0.0
npm ERR! Found: pdfkit@0.15.0
npm ERR! node_modules/pdfkit
npm ERR!   pdfkit@"^0.15.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer pdfkit@"^0.11.0" from @signpdf/placeholder-pdfkit@3.2.4
npm ERR! node_modules/@signpdf/placeholder-pdfkit
npm ERR!   @signpdf/placeholder-pdfkit@"*" from the root project

Is it a bug in signing or in the helpers? It shows up with placeholder-pdfkit helper.

To Reproduce Using pdfKit with version greater than 0.11.0 the dependency error appears if you try to install placeholder-pdfkit.

Dmitrijs-Sakovics commented 7 months ago

this is a quirk of Semantic Versioning: placeholder-pdfkit has a peer dependency of pdfkit "^0.11.0", which means "0.11.x" (because the version is lower than "1.0.0")

to allow all versions "0.x.y" for x>=11, you actually want the reference to be something like ">=0.11.0 <1.0.0"

vbuch commented 7 months ago

We have to fix that

tfrancois commented 4 months ago

Not sure if this is related, but adding the @signpdf/placeholder-plain to my project adds 118 packages! Not seeing where in the dependency tree of the packages specified in the package.json of either ...plain and ...pdfkit010 that all of these dependencies are necessary. That kind of bloat significantly forced me to revert to using the pdf-lib placeholder implementation even though it doesn't support multiple signers. Please help and advise.