Home > Software design >  Passing arguments to a dependent task in gradle
Passing arguments to a dependent task in gradle

Time:01-11

When I run ./gradlew bootRun, I'd like for the npmInstall task that it depends on to run with the "--force" or "--legacy-peer-deps" arguments.

I tried using ./gradlew bootRun npm_install_--force but this doesn't make the npm install task that runs before the bootRun task use the --force argument. How can I pass either one of these arguments to the npmInstall task?

I'm running on windows and I need either one of these arguments so that I can resolve angular dependency issues. The npm version is 8.19.2

CodePudding user response:

You should be able to create an .npmrc file with the following contents to solve this:

legacy-peer-deps=true
  • Related