husky 安装问题
来源:2-11 使用 husky + commitlint 检查提交描述是否符合规范要求
慕工程6470950
2021-11-10
执行指令
npx husky add .husky/commit-msg 'npx --no-install commitlint --edit “$1”'
报错
报错信息
20 timing npm:load Completed in 17ms
21 timing command:exec Completed in 71ms
22 verbose stack Error: command failed
22 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack at ChildProcess.emit (events.js:315:20)
22 verbose stack at maybeClose (internal/child_process.js:1048:16)
22 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
23 verbose pkgid imooc-admin@0.1.0
24 verbose cwd /Users/zy/Desktop/vue3/imooc-admin
25 verbose Darwin 20.6.0
26 verbose argv “/usr/local/bin/node” “/usr/local/lib/node_modules/npm/bin/npm-cli.js” “exec” “–” “husky” “add” “.husky/commit-msg” "npx --no-install commitlint --edit "$1""
27 verbose node v14.15.1
28 verbose npm v7.3.0
29 error code 2
30 error path /Users/zy/Desktop/vue3/imooc-admin
31 error command failed
32 error command sh -c husky add .husky/commit-msg npx --no-install commitlint --edit "$1"
33 verbose exit 2
1回答
-
Sunday
2021-12-09
你好
husky 的安装一定要按照课程中提到的版本进行安装,包括 node 、husky 等。以避免出现意料之外的问题
00
相似问题