[Pkg-javascript-devel] Bug#1019291: yarnpkg: depends on incompatible version of commander

Adrien Samson adrien at adriensamson.fr
Thu Nov 10 16:44:28 GMT 2022


Dear maintainer,

I experience a similar issue with yarn and the commander version: command options are ignored.
For example: `yarn add -D typescript` saves the dependency to dependencies instead of devDependencies. The -D is simply ignored.

I've found that you have a patch for commander >= 8 where you replace most occurrences of commander by commanderOpts. It's missing the same replacement on line 306:

--- a/src/cli/index.js
+++ b/src/cli/index.js
@@ -303,7 +303,7 @@ export async function main({
       reporter.warn(reporter.lang('dashDashDeprecation'));
     }
 
-    return command.run(config, reporter, commander, commander.args).then(exitCode => {
+    return command.run(config, reporter, commanderOpts, commander.args).then(exitCode => {
       if (shouldWrapOutput) {
         reporter.footer(false);
       }

This fixes my issue but I can't tell whether it also fixes the original reporter's issue.

Best regards
Adrien
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/pkg-javascript-devel/attachments/20221110/d0d43eec/attachment.htm>


More information about the Pkg-javascript-devel mailing list