npm postinstall script with published package

1.2k views Asked by At

I just created my package and published it to artifact registry. This package has postinstall script that works if I do npm i inside package directory, even if there is no node_modules directory.

Inside postinstall script I use patch-package from npm to overwrite few dependencies.

The problem is when I install this package in other project with npm i -s @my/package. When postinstall script is executing it doesn`t find those packages and throw errors.

I tried to execute patch-package in parent directory but it does not find those packages anyway.

Any idea what I can do to fix this?

1

There are 1 answers

0
czlowiek488 On

To fix problem I added in postinstall script installation script for those packages npm i [email protected] [email protected] [email protected] && rest....