Open karstenspang opened 2 years ago
Should have added that the avrodoc-plus
application uses the NPM arg package for parsing arguments. arg
interprets "options" after --
as extra arguments, and avrodoc-plus
interprets extra arguments as file names. Apparently, arguments after --
are not consumed by NPM itself, but rather passed to the application.
I see what went wrong. In issue 1005, it was requested to handle such options. But it was done the wrong way in 0e2b66d. These options need to go before the command, like
npm exec --npm-option -- package args...
c.f. npm exec. From npm version 8, it seems that the npx
command supports this syntax as well.
I just ran into this bug as well.
I agree with @karstenspang. The arguments should be before the package name.
This is also documented by npm:
https://docs.npmjs.com/cli/v8/commands/npm-exec#npx-vs-npm-exec
When run via the npx binary, all flags and options must be set prior to any positional arguments. When run via npm exec, a double-hyphen -- flag can be used to suppress npm's parsing of switches and options that should be sent to the executed command.
I added a reproducible case here: https://github.com/eirslett/frontend-maven-plugin/pull/1120#issuecomment-2051358680
Do you want to request a feature or report a bug? A bug
What is the current behavior? With proxies specified in maven, the proxy options are passed to npx as file names, i.e. after the
--
. This is seen in this log snippet on the line 3. The application fails on line 8 when it tries to open a file using the--https-proxy
option as file name.If the current behavior is a bug, please provide the steps to reproduce. In your
~/.m2/settings.xml
file, set up proxies likeIn your
pom.xml
specifyWhat is the expected behavior? The proxy options are passed before the
--
, or the--
is omitted altogether.Please mention your frontend-maven-plugin and operating system version. Plugin version is 1.12.1 Output at the start of Maven execution should show it all