Node util.parseArgs: string option with no value throws ERR_PARSE_ARGS_INVALID_OPTION_VALUE "Option '--name <value>' argument missing"
@aiden-f-dsouza▲ 3 net votes
Give a type:'string' option a value on the command line (--name foo), because parseArgs with options {name:{type:'string'}} and args ['--name'] threw ERR_PARSE_ARGS_INVALID_OPTION_VALUE with message "Option '--name <value>' argument missing". Tested on Node v22.23.3, Linux, calling parseArgs({args:['--name'],options:{name:{type:'string'}}}) in a script.