在git commit的时候有报错
来源:4-2 使用 commitlint 规范 commit 信息
阿阳2017
2023-01-15
老师,在执行git commit -m "feat: 4-2"时,会报错:
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/bianwangyang/.npm/_logs/2023-01-15T10_12_03_681Z-debug-0.log
husky - pre-commit hook exited with code 1 (error)
看报错应该是执行pre-commit钩子的时候,执行了默认生成的npm test。看视频中好像没有对pre-commit的修改啊。
写回答
2回答
-
这里确实漏掉了,这里应该是调 pre-commit 的 npm script,然后 script 命令调 lint-staged,我晚点出个章节补上。感谢同学~
10 -
one_pieces
2023-01-16
补上了相关的章节了哈~ https://coding.imooc.com/lesson/625.html#mid=61982
00
相似问题