Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Twilio CLI prints punycode module deprecation warning on every launch #560

Open
elyscape opened this issue Nov 18, 2023 · 19 comments
Open
Labels

Comments

@elyscape
Copy link

elyscape commented Nov 18, 2023

Issue Summary

When installed via Homebrew, all invocations of the Twilio CLI print a deprecation error.

Steps to Reproduce

  1. Run any twilio command
  2. There is no second step

Log

$ twilio version
(node:78395) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
twilio-cli/5.16.2 darwin-arm64 node-v21.2.0

Technical Analysis

While the installation docs state that the Twilio CLI only supports Node.js 18, the Homebrew formula for the Twilio CLI depends on the node formula, which resolves to the current stable version of Node.js. At time of writing, that means version 21.2.0.

Node.js' built-in punycode module was documented as deprecated in version 7.0.0, but for version 21.0.0 the deprecation was upgraded to a runtime deprecation. As a result, any code running on Node.js 21 that imports the punycode module will cause the runtime to log a deprecation warning.

The long-term solution here is to figure out what library depends on the built-in punycode module and either get rid of it or upgrade it. However, the Homebrew formula should be updated to actually use the version of Node.js that you intend for it to support. That can be done by making it look something like this:

class Twilio < Formula
  # [...]
  depends_on "node@18"

  def install
    inreplace "bin/twilio", /^CLIENT_HOME=/, "export TWILIO_OCLIF_CLIENT_HOME=#{lib/"client"}\nCLIENT_HOME="
    libexec.install Dir["*"]
    (bin/"twilio").write_env_script libexec/"bin/twilio", PATH: "#{Formula["node@18"].opt_bin}:$PATH"
  end

  def post_install
    node = Formula["node@18"].opt_bin/"node"
    pid = spawn("#{node} #{libexec}/welcome.js")
    Process.wait pid
  end
end

Technical details:

  • twilio-cli version: 5.16.2
  • node version: 21.2.0
elyscape added a commit to elyscape/twilio-homebrew-tap that referenced this issue Nov 28, 2023
The installation docs state that the Twilio CLI only supports Node.js
18, and there are some minor compatability issues with Node.js 21, which
is what the `node` formula currently resolves to.

See-also: twilio/twilio-cli#560
elyscape added a commit to elyscape/twilio-homebrew-tap that referenced this issue Dec 5, 2023
The installation docs state that the Twilio CLI only supports Node.js
18, and there are some minor compatability issues with Node.js 21, which
is what the `node` formula currently resolves to.

See-also: twilio/twilio-cli#560
Copy link

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added the Stale label Dec 29, 2023
@elyscape
Copy link
Author

Still present.

@github-actions github-actions bot removed the Stale label Dec 31, 2023
Copy link

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jan 30, 2024
@ZacharyDuBois
Copy link

Still here.

@github-actions github-actions bot removed the Stale label Feb 13, 2024
@mkarroqe
Copy link

mkarroqe commented Mar 12, 2024

This is still an issue. However, I found a workaround in bitwarden/clients#6689 (comment)

I didn't want to set --no-deprecation globally since I use Node at work. My temp workaround was to make an alias for bw:

# Temp workaround to disable punycode deprecation logging to stderr
# https://github.com/bitwarden/clients/issues/6689
alias bw='NODE_OPTIONS="--no-deprecation" bw'

this worked for me for the time being! thanks @kschat for this one

Copy link

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added the Stale label Apr 12, 2024
@ZacharyDuBois
Copy link

Go away stale bot. An issue doesn't magically fix itself when no one replies.

@github-actions github-actions bot removed the Stale label Apr 13, 2024
@tiwarishubham635
Copy link
Contributor

Looking at it now

@ajostergaard
Copy link

IIRC I worked around this by manually installing brew install node@20 and uninstalling the version installed as a dependency using brew uninstall --ignore-dependencies node so:

brew install node@20
brew tap twilio/brew && brew install twilio
brew uninstall --ignore-dependencies node

Copy link

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added the Stale label May 24, 2024
@compuguy
Copy link

Has this been fixed?

@github-actions github-actions bot removed the Stale label May 25, 2024
@elyscape
Copy link
Author

elyscape commented Jun 1, 2024

@tiwarishubham635 I submitted a PR back in November that fixes this (twilio/homebrew-brew#36). It's out of date now but could be trivially updated to work. Can we get some movement on this?

Copy link

github-actions bot commented Jul 1, 2024

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added the Stale label Jul 1, 2024
@ajostergaard
Copy link

Not stale and very annoying. Most annoying thing is that the fix is there for the taking (thanks @elyscape) but maintainers are nowhere to be seen. :( Oh and Twilio is a paid service so the gripe is warranted.

@tiwarishubham635
Copy link
Contributor

Hi @elyscape! Since twilio-cli has moved completly to node18, I think this change should be good to go. Can you update your PR? I have checked it and will approve it right away. Sorry for the delay everyone.

@github-actions github-actions bot removed the Stale label Jul 2, 2024
elyscape added a commit to elyscape/twilio-homebrew-tap that referenced this issue Jul 9, 2024
The installation docs state that the Twilio CLI only supports Node.js
18, and there are some minor compatability issues with Node.js 21, which
is what the `node` formula currently resolves to.

See-also: twilio/twilio-cli#560
@elyscape
Copy link
Author

elyscape commented Jul 9, 2024

@tiwarishubham635 PR updated.

@auman66
Copy link

auman66 commented Jul 16, 2024

@elyscape - Your PR seems to have fixed it for me. I pinged @tiwarishubham635 to see if he can review and push the change. Thanks for your contribution!

shrutiburman pushed a commit to twilio/homebrew-brew that referenced this issue Jul 17, 2024
The installation docs state that the Twilio CLI only supports Node.js
18, and there are some minor compatability issues with Node.js 21, which
is what the `node` formula currently resolves to.

See-also: twilio/twilio-cli#560
@tiwarishubham635
Copy link
Contributor

Since the changes are pushed to homebrew repo, that should fix it. We can close this issue after the next release

Copy link

This issue is stale because it has been open for 30 days with no activity. Please remove stale label or comment or this issue will be closed in 30 days.

@github-actions github-actions bot added the Stale label Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants