-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 7.x.x/8.x.x fails to parse fields of type path #1545
Comments
I have not managed to reproduce on Mac. What version of node are you using? I suspect the error is coming from the import line itself rather than the rest of the code. Commander v7.1.0 added a wrapper for esm to support named imports (see #1440). The new syntax is: import { program } from 'commander/esm.mjs'; |
I am on Node 14.17. I'll try the suggested fix, Thank you |
After applying the suggested fix, I still get the same error. I also tried, import { Command } from "commander/esm.mjs";
const program = new Command(); but I still get the same error. I am testing this with Node 14.xx on Linux and Windows. |
Are you running more code in your failing case than in the example code you gave, and trying to read the file using The way options are stored by default has changed between Commander v6 and v7. The code that will work with default behaviour in both is See e.g. #1441 |
This was the problem! I inherited this old code, somehow commander version was updated to 7.x.x from 6.x.x and I didn't notice. I was still reading arguments like, Thank you so much for your time and helping me with this. |
Here is the code,
I call the program like,
With
commander
version^7.0.0
OR^8.0.0
, This fails with the error down below.^6.0.0
works fine.Error log,
The text was updated successfully, but these errors were encountered: