Skip to content
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

CLI csv2json -h results in an error #17

Closed
3 of 4 tasks
porg opened this issue Aug 28, 2024 · 3 comments
Closed
3 of 4 tasks

CLI csv2json -h results in an error #17

porg opened this issue Aug 28, 2024 · 3 comments

Comments

@porg
Copy link

porg commented Aug 28, 2024

Reproduction

  • In the CLI version
    • csv2json --help, json2csv --help and json2csv --h all work fine
    • but csv2json -h results in an error.

Expected Behavior

  • csv2json -h Shows the help screen

Actual Behavior

  • Results in an error
$ json2csv --help

# Shows the help screen fine

$ json2csv -h    

# Shows the help screen fine

$ csv2json --help

# Shows the help screen fine

$ csv2json -h    
/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:581
      throw err;
      ^

TypeError: Cannot read properties of undefined (reading 'split')
    at Option.constructKeysList [as parseArg] (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/bin/utils/utils.js:88:17)
    at Command._callParseArg (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:575:21)
    at handleOptionValue (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:674:20)
    at Command.<anonymous> (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:694:7)
    at Command.emit (node:events:520:28)
    at Command.parseOptions (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:1689:18)
    at Command._parseCommand (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:1449:25)
    at Command.parse (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/node_modules/commander/lib/command.js:1064:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/@mrodrig/json-2-csv-cli/bin/csv2json.js:23:6)
    at Module._compile (node:internal/modules/cjs/loader:1504:14)

Node.js v22.5.1

$

Background Information

  • Module Version: 5.5.5
    • Installed a global app via npm install -g @mrodrig/json-2-csv-cli
  • Node: v22.5.1
  • OS: macOS 13.6.9 Ventura
    • Terminal.app running zsh, nevertheless I used the $ symbol from bash, as it's more conventional.

The issue I'm reporting is with:

  • json2csv
  • csv2json

I have...

  • searched to see if an issue has already been reported.
  • tried upgrading to the latest version of json-2-csv (since the issue may already be fixed).
  • verified that my JSON/CSV data is valid (using something like http://jsonlint.com or https://csvlint.io/).
    • does not apply as my bug occurs with csv2json -h which uses no input/output at all.
@porg
Copy link
Author

porg commented Sep 22, 2024

@mrodrig it's a minor bug but still I'd appreciate a reaction. Thanks!

@mrodrig mrodrig transferred this issue from mrodrig/json-2-csv Sep 26, 2024
@mrodrig
Copy link
Owner

mrodrig commented Sep 26, 2024

Sorry for the delay getting back to you @porg. This is definitely an issue, so I'll see if I can track it down and will plan to publish a fix for this in 5.5.6 when I pull in another fix from json-2-csv@5.5.6. Thank you for reporting it and your patience.

@mrodrig
Copy link
Owner

mrodrig commented Sep 26, 2024

This should be resolved in version 5.5.6 that's on NPM now. Please let me know if you're still experiencing the error after updating.

@mrodrig mrodrig closed this as completed Sep 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants