微前端singleSpa提交代码git commit -m报错husky - pre-commit hook exited with code 1 (error),踩坑!

问题

微前端基座,提交代码git commit -m的时候会出现已下内容报错。

 git commit -m "first commit"

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
    whoami

npm <command> -h  quick help on <command>
npm -l            display full usage info
npm help <term>   search for help on <term>
npm help npm      involved overview

Specify configs in the ini-formatted file:
    C:\Users\Administrator\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config

[email protected] D:\codeLive\nvm\v14.17.0\node_modules\npm

husky - pre-commit hook exited with code 1 (error)

解决方案:
更换更高版本的node即可。
博主从14.17.0—》更新至18.16.0 就ok

分析原因:
暂无时间分析,问题解决即可,后续会给出。

猜你喜欢

转载自blog.csdn.net/weixin_44000173/article/details/131504850