1

I am trying to fix an issue related to worker version between the versions of pdfjs-dist used by my package pdf-viewer-reactjs@2.2.3 and package react-pdf@5.4.0.

I came across the option( How do I override nested NPM dependency versions? ) to override the version used by pdf-viewer-reactjs@2.2.3 which is "pdfjs-dist": "^2.6.347" by adding the following in my package.json

"overrides": { "pdf-viewer-reactjs": { "pdfjs-dist": "$pdfjs-dist" } }

Example of current package.json

enter image description here

My questions are:

1.Why doesnt override work?When using npm install the version used and installed in both my package-lock.json and in the node_module is still 2.6.347(despite npm list saying otherwise). Should it not be using this version(located in my dependencies section in package-json)?

enter image description here

2.Why does npm list --depth=1 show me this:

enter image description here

It shows that the sub-dependency used is the correct version however, if i check the package.json(which is auto generated when running npm install) in node_modules for pdf-viewer-reactjs it is still 2.6.347

enter image description here

Malsum
  • 91
  • 1
  • 5

0 Answers0