Do not run npm postinstall scripts on devDependencies

I am creating some private npm packages and have a postinstall script in these packages. The postinstall script works fine when I develop the package, but the problem that I am facing is that I inject the package into another project and execute the installation and it runs the devdevelopment postinstall script. I do not want this to be done, I only want it to perform postinstall if I do the installation from this directory. How can I do this or what can I use instead of postinstall to accomplish the same thing without encountering this problem?

+4
source share

Source: https://habr.com/ru/post/1689994/


All Articles