Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Commitlint not working. git commit -m commitlint message showing unknown argument , husky existed with code 1 (error)

git commit -m "feat: testing the commitlint library" @commitlint/[email protected] - Lint your commit messages

[input] reads from stdin if --edit, --env, --from and --to are omitted

Options:
  -c, --color          toggle colored output           [boolean] [default: true]
  -g, --config         path to the config file                          [string]
      --print-config   print resolved config          [boolean] [default: false]
  -d, --cwd            directory to execute in
                                         [string] [default: (Working Directory)]
  -e, --edit           read last commit message from the specified file or      
                       fallbacks to ./.git/COMMIT_EDITMSG               [string]
  -E, --env            check message in the file at path given by environment   
                       variable value                                   [string]
  -x, --extends        array of shareable configurations to extend       [array]
  -H, --help-url       help url in error message                        [string]
  -f, --from           lower end of the commit range to lint; applies if        
                       edit=false                                       [string]
  -o, --format         output format of the results                     [string]
  -p, --parser-preset  configuration preset to use for
                       conventional-commits-parser                      [string]
  -q, --quiet          toggle console output          [boolean] [default: false]
  -t, --to             upper end of the commit range to lint; applies if
                       edit=false                                       [string]
  -V, --verbose        enable verbose output for reports without problems
                                                                       [boolean]
  -v, --version        display version information                     [boolean]
  -h, --help           Show help                                       [boolean]

Unknown argument: edit
husky - commit-msg hook exited with code 1 (error)

like image 229
AWE FRANCIS OLAWUMI Avatar asked Jun 08 '26 15:06

AWE FRANCIS OLAWUMI


1 Answers

for Windows OS I later solve the problem by going to my .husky folder and edit npx --no -- commitlint edit to npm commitlint --edit

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no -- commitlint edit 

to

#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx commitlint --edit 

like image 87
AWE FRANCIS OLAWUMI Avatar answered Jun 11 '26 22:06

AWE FRANCIS OLAWUMI



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!