FAQ
Error: require() of ES Module ... not supported
[MODULE_TYPELESS_PACKAGE_JSON] Warning: Module type of xxxx is not specified and it doesn't parse as CommonJS.
- If you are an ESM project (i.e.,
"type": "module"
in package.json) or usingimport
syntax,- You can try changing the configuration name from
.js
to.cjs
ormjs
.
- You can try changing the configuration name from
- If you are using commitlint version (> 18),
- For example, configuring
extends: ['@commitlint/config-conventional']
, - Please upgrade cz-git or czg to the latest version.
- For example, configuring
Can I customize the message format ?
- The configuration contains most of the message format fine-tuning requirements, such as changing the emoji position with emojiAlign.
- formatMessageCB: It is the final format callback function. You can configure it to achieve the message format you need.
Configure load not as expected
Run the command to check the path of the configuration load
sh
# commitizen cli
CZ_DEBUG=1 cz
# czg cli
CZ_DEBUG=1 czg
# commitizen cli
CZ_DEBUG=1 cz
# czg cli
CZ_DEBUG=1 czg
Opening a like vim
editor in git hooks mode
The
prepare-commit-msg
githook opens an editor after the commit message has been prepared => githooks man
- Changing the default git editor from
vi
tocat
and have a tryshgit config --local core.editor cat
git config --local core.editor cat
- Adding package scripts initialization script
prepare
or pnpm'spostinstall
to assist other contributors with initializationdiff{ "scripts": { - "prepare": "husky install" + "prepare": "husky install && git config --local core.editor cat" } }
{ "scripts": { - "prepare": "husky install" + "prepare": "husky install && git config --local core.editor cat" } }
Modifying the editor (EDITOR) used when choosing to edit during commit confirmation (Yneh)
Here's an example using VSCode
code --wait
command
cz-git|czg: v >= 1.10.0CZ_EDITOR
, v < 1.10.0EDITOR
||VISUAL
.
sh
export CZ_EDITOR="code --wait"
export CZ_EDITOR="code --wait"
json
{
"scripts": {
"commit": "cross-env CZ_EDITOR='code --wait' cz"
}
}
{
"scripts": {
"commit": "cross-env CZ_EDITOR='code --wait' cz"
}
}
Cannot find the command after global install
- Enter the command
npm prefix -g
to check whether the bin folder path of npm's global download is added to the system environment variable$PATH
. - Most likely because using nvm changed the npm global download path prefix, but the system environment variable was not recorded.
Terminal cannot display Emoji symbols
- The terminal cannot Emoji symbols, the high probability is because your terminal has poor support for emoji/unicode characters, but it does not affect the submission Because the final output is submitted by Emoji Code, you can consider changing the terminal and font
What is different between cz-git
and czg
See more Why czg
- If you using
cz
orgit cz
command will startcommitizen
CLI +cz-git
adapter - If you using
czg
orgit czg
command will only startczg
CLI