Zhengqbbb / cz-git

cz-git | czg πŸ› οΈ DX first and more engineered, lightweight, customizable, standard output format Commitizen adapter and CLI
https://cz-git.qbb.sh
MIT License
1.11k stars 41 forks source link

[Bug report] cli cgz cannot start #115

Closed ichaozai closed 1 year ago

ichaozai commented 1 year ago

βœ… Checklist

πŸ“„ System Info

$ npx envinfo --system --binaries --npmPackages cz-git --npmPackages commitizen --npmPackages czg --npmGlobalPackages cz-git --npmGlobalPackages commitizen --npmGlobalPackages czg
npx: installed 1 in 2.254s

  System:
    OS: Linux 5.10 Ubuntu 20.04.4 LTS (Focal Fossa)
    CPU: (16) x64 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz
    Memory: 13.59 GB / 15.51 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 10.19.0 - /usr/bin/node
    npm: 6.14.4 - /usr/bin/npm
  npmGlobalPackages:
    commitizen: 4.3.0
    czg: 1.6.1

πŸ”Ž Description

Concise Description

I use Windows WSL2. After install cgz

$ sudo npm install -g czg
$ czg --help
(node:763) UnhandledPromiseRejectionWarning: Error: Not supported
    at Object.<anonymous> (/usr/local/lib/node_modules/czg/bin/index.js:3:1)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:831:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:763) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:763) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Expected behavior

Steps to reproduce

Screenshots or Screen Recording(if possible)

πŸ”— Reproduction link / repo:

No response

Zhengqbbb commented 1 year ago

Thanks for the feedback, it seems Node v10 compatibility issues, If you can you can use commitizen CLI + cz-git, or upgrade Node version >= 12 first

Zhengqbbb commented 1 year ago

@ichaozai

Of course, if you are using commitizen v4.3.0, it won't work either

image

But there is an alternative, commitizen@4.2.6 + cz-git@1.3.8

npm install -g commitizen@4.2.6 cz-git@1.3.8
echo '{ "path": "cz-git" }' > .czrc
cz # or `git cz`
CleanShot 2023-03-24 at 14 50 22@2x

I will make a note in the documentation, thanks again for your feedback