(node:75956) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
Opened this issue · 4 comments
I didn't see any issues referencing this deprecation, so just wanted to post a notification.
Node 21.2.0 has deprecated the punycode
module. Since upgrading my node version to 21.2.0 I see the deprecation warning with every leapp cli command I run. This is particularly noisy in some scripts I have where multiple leapp commands are used together and each one emits the deprecation warning.
❯ leapp profile list
(node:75956) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Profile Name
─────────────────────────────────────────────
default
Leapp Version
❯ leapp --version
@noovolari/leapp-cli/0.1.46 darwin-arm64 node-v21.2.0
Additional context
This came up for me because I don't use node on my host specifically so I wasn't paying close attention to the version. I had just installed it via brew install node
and letting it upgrade when I do my brew updates.
I was able to uninstall node with brew uninstall --ignore-dependencies node
(I needed --ignore-dependencies
because the leapp brew formula depends on) and then switching to nvm to install the lts version explicitly.
Thanks for this feedback. I think that upgrading the package json will solve this issue.
Thanks for pointing it out!
Hi @Pat-Ayres we are currently investigating alternatives to the library, in the meanwhile you can add this command NODE_OPTIONS="--no-deprecation"
to your .bashrc/.zshrc or use it before the commands to hide the warning. Let me know if this can help as a workaround
@urz9999 Thanks for the suggestion, but unfortunately it didn't work for me. I added the line to my .zshrc
file, source
'd, but still saw the deprecation warnings when I ran leapp profile list
. I'm on node
v21.4.0. I did confirm NODE_OPTIONS
was set in the shell with echo $NODE_OPTIONS
.
The workaround to use nvm
instead was successful.
Hi @murshed-panorama, I did a test with node v21.4.0
I appended export NODE_OPTIONS='--no-deprecation'
to my ~/.zshrc file, sourced it, and run leapp profile list
.
The following is the output (I've just a single default profile):
❯ leapp profile list
Profile Name
────────────
default
Well, this is just a way to hide the deprecation warning; a valid alternative to the deprecated punycode module should be used.