I propose exposing a hook to allow for increased windows compatibility for run-script. NPM run script has become increasingly popular lately as a replacement for grunt and gulp. The problem is that it is easy to encounter module maintainers who may be apathetic or hostile towards windows compatibility, and they are using commands in their run-script that won't work on windows (and in some cases even refusing PRs which fix the issue...)
Have a global setting that can be used to run some code prior to executing an npm script. This code would be able to see the command and the current directory, and would have an opportunity to make adjustments to the command before running it, or perhaps run the command itself.
Eventually this could allow Windows users to run most bash style npm scripts without a VM or WSL.
We could solve many error conditions, such as:
I recognize that a perfect solution to all the bash<=>cmd issues is either super difficult or impossible, but having a hook would allow for an effort external to NPM's development cycle which could build and evolve something to handle as many use cases as possible.
No, I have a Linux VM and I know how to use it. I would comment though, that cross-platform compatibility is the primary reason I started using node.js, and as a Windows user, it is disheartening to see some community members who are the among the greatest beneficiaries of cross-platform development becoming obstacles to it.
We just need the ability to do something like those without having to shim it into each and every package.
I found some existing issues that would could be better resolved if we could do this:
It wasn't very hard to find those, and there are probably dozens more.