git cz: Missing script: “test“ To see a list of scripts, run: npm run
git cz报错;git commit 报错git commit -m 'feat: xxx'error: pathspec 'xxx' did not match any file(s) known to git
·
- git cz报错
情况1:
git cz
cz-cli@4.2.4, cz-conventional-changelog@3.3.0
? Select the type of change that you're committing: feat: A new feature
? What is the scope of this change (e.g. component or file name): (press enter to skip)
? Write a short, imperative tense description of the change (max 94 chars):
(7) "初始化项目"
? Provide a longer description of the change: (press enter to skip)
? Are there any breaking changes? No
? Does this change affect any open issues? No
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! C:\Users\Q\AppData\Local\npm-cache\_logs\2022-06-13T07_51_09_639Z-debug.log
husky - pre-commit hook exited with code 1 (error)
git exited with error code 1
C:\Users\Q\Desktop\my-project\myvue3app\my-vue3app>git cz
cz-cli@4.2.4, cz-conventional-changelog@3.3.0
解决:
添加 package.json的scripts添加 test 命令
- 执行commit 报错
git commit -m 'feat: xxx'
error: pathspec 'xxx' did not match any file(s) known to git
在Linux系统中,commit信息使用单引号包括,windows系统,commit信息使用双引号。因此,在git bash中git commit -m ‘提交说明’ 这样是可以的,但是在win命令行中就要使用双引号。
更多推荐
已为社区贡献2条内容
所有评论(0)