0
> git commit -m "commit message"
npm ERR! Missing script: "test"
npm ERR! 
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/user/.npm/_logs/2022-01-25T15_32_42_915Z-debug-0.log
husky - pre-commit hook exited with code 1 (error) 

The .husky/pre-commit script includes an npm test which looks for that script inside package.json. The test script doesn't exist and I can only commit with the --no-verify flag to skip, which consequently skips the npx lint-staged step.

  • 1
    Can you... create the missing script? – Horațiu Udrea Jul 06 '22 at 20:02
  • Does [this](https://stackoverflow.com/questions/63943401/husky-pre-commit-hook-failed-add-no-verify-to-bypass) solve your issue? – Señor CMasMas Jul 06 '22 at 20:30
  • 1
    You have installed a pre-commit hook. Your pre-commit hook has a bug in it. That's all we can tell you here, because you have not told us where you got your pre-commit hook or what you'd like it to test. See also [ask]. – torek Jul 06 '22 at 21:21

0 Answers0