commit 报错 husky

473 阅读1分钟

commit 报错 this.options.fields ??= {};

                    ^^^

SyntaxError: Unexpected token '??=' at Loader.moduleStrategy (internal/modules/esm/translators.js:149:18) husky - pre-commit hook exited with code 1 (error)

解决方法

1、node版本切换为16 参考 juejin.cn/post/727626…

2、> git config --unset core.hooksPath