Use npx instead of npm install
We worked really hard in the Gradle plugin to avoid cluttering up the current working directory with Node.js modules (e.g., node and node_modules folers) in order to hide that all away. This plugin should use npx
instead of npm install
. The added benefit is that npx
has intelligent caching, so it avoids trying to install the modules each time it is run.
The only time npm install
should be used is if the project has a package.json file that contains dependencies, since npx will not try to install the dependencies listed there.
In effect, we want to duplicate the strategy used by the Gradle plugin. See the following lines of code: