@muspi-merol It may not be applicable for your situation, (and doesn’t align with your wider configuration requests), but have you considered trying the legacy-peer-deps
flag?
https://docs.npmjs.com/cli/v9/using-npm/config#legacy-peer-deps
It can be applied with the NPM_FLAGS
environment variable, for which there is more detail here:
With #5, if you did want to delete your node_modules
you could just do so within your build command, as the node_modules
won’t be in your Publish directory they could be safely deleted after build but prior to deployment.