eirslett / frontend-maven-plugin

"Maven-node-grunt-gulp-npm-node-plugin to end all maven-node-grunt-gulp-npm-plugins." A Maven plugin that downloads/installs Node and NPM locally, runs NPM install, Grunt, Gulp and/or Karma.
Apache License 2.0
4.23k stars 867 forks source link

Run yarn install --ignore-engines in a Dockerfile #902

Open juliensutter opened 4 years ago

juliensutter commented 4 years ago

Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

We run the following commands in a Dockerfile : RUN ./mvnw -B com.github.eirslett:frontend-maven-plugin:install-node-and-yarn -DnodeVersion=v6.11.1 -DyarnVersion=v0.27.5 RUN ./mvnw -B com.github.eirslett:frontend-maven-plugin:yarn

We would like to run the command yarn install --ignore-engines but when we change the Dockerfile like that :

RUN ./mvnw -B com.github.eirslett:frontend-maven-plugin:yarn -Darguments=install --ignore-engines we have the following erro in our Gitlab CI pipeline :

Step 5/21 : RUN ./mvnw -B com.github.eirslett:frontend-maven-plugin:yarn -Darguments=install --ignore-engines ---> Running in ca24fd17e6d3 Unable to parse command line options: Unrecognized option: --ignore-engines

If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?

How can we pass the argument ignore-engines in the Dockerfile command ?

Please mention your frontend-maven-plugin and operating system version.

frontend-maven-plugin:1.10.0:install-node-and-yarn

neoxpert commented 4 years ago

If the argument to pass should be "install --ignore-engines" you have to add proper quoting. Otherwise the whitespace between install and --ignore-engines will cause --ignore-engines to be interpreted as a separate command from install - as the error message indicates.

So it should be -Darguments="install --ignore-engines" with the quotes.