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.13k stars 41 forks source link

[Bug]: Node 22 `punycode` and `fs.Stats` is deprecated error message #178

Closed cloudyparts closed 4 months ago

cloudyparts commented 4 months ago

💭 Describe the feature

punycode

Deprecated since: v7.0.0

Source Code: lib/punycode.js

The version of the punycode module bundled in Node.js is being deprecated. In a future major version of Node.js this module will be removed. Users currently depending on the punycode module should switch to using the userland-provided Punycode.js module instead. For punycode-based URL encoding, see url.domainToASCII or, more generally, the WHATWG URL API.

💡 Proposed Solution

Please replace with Punycode

cloudyparts commented 4 months ago

I'm currently using this as a workaround for Node 22.2

NODE_OPTIONS="--no-deprecation" npx czg
Zhengqbbb commented 4 months ago

Could u provide node version and start up error message

cloudyparts commented 4 months ago

Thanks for reviewing, let me know if you want/need more information.

(node:91890) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
    at node:punycode:3:9
    at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:398:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
    at loadBuiltinModule (node:internal/modules/helpers:96:7)
    at Module._load (node:internal/modules/cjs/loader:1037:17)
    at Module.require (node:internal/modules/cjs/loader:1271:19)
    at require (node:internal/modules/helpers:123:16)
    at /xxxxxxx/node_modules/czg/lib/index.js:104:268891
    at /xxxxxxx/node_modules/czg/lib/index.js:1:663
    at /xxxxxxx/node_modules/czg/lib/index.js:104:285695
czg@1.9.3
❯ node --version
v22.2.0
Zhengqbbb commented 4 months ago

Upstream node-fetch error, wait for new package version and bump dep https://github.com/node-fetch/node-fetch/issues/1797 https://github.com/openai/openai-node/issues/527


I think there must be a better way to deal with this, and now which is ridiculous.

Zhengqbbb commented 4 months ago

Thank you for pointing out the issue with this node@22 version. I have currently released a pre-release version 1.9.4-beta.1 for testing. I plan to conduct tests over the weekend. During this period, you can try it out and discover more issues. Thanks again.

npm install -g czg@next

CleanShot 2024-07-15 at 20 55 35@2x

Zhengqbbb commented 4 months ago

The latest version 🌟(v1.9.4)🌟 should be resolve this issue request , please have a try. 💪 👀 Let me know if there are still any issues. 🎉

cloudyparts commented 3 months ago

Thank you for the quick response! This resovled my issue.