0

I updated some libraries within my project and now I get an issue with the zlib within ng2-pdf-viewer. There is also an issue created on github, that helped to fix it for now: https://github.com/VadimDez/ng2-pdf-viewer/issues/322#issuecomment-389281242

The solution suggests to create a zlib folder within node_modules and add an empty index.js and a basic package.json.

This fixed the issue. But now I want to automate the process, since every time anyone runs npm install the pseudo folder is gone again.

Is there any way to create this folder with it's content automatically on npm install (maybe with mkdir or something)?

PS: The solution to put "browser": { "zlib": false } into the package.json didn't help in my case...

Zoker
  • 2,020
  • 5
  • 32
  • 53

1 Answers1

2

You should be able to create a script to create the directory, and then use a hook to run that script after you run npm install:

"scripts": {
    "postinstall": "myCustomScriptToCreateFolder",
},

More reading:

JeffryHouser
  • 39,401
  • 4
  • 38
  • 59