In your package.json
file add the following two script declarations:
"scripts": {
"preinstall": "node preinstall.js",
"postinstall": "node postinstall.js"
},
In your entry script, add the followig code to make sure the working directory is set to the script so the node_modules
folder resolves correctly: