-
Notifications
You must be signed in to change notification settings - Fork 693
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
Node.js 21: "[DEP0040] DeprecationWarning: The punycode
module is deprecated."
#789
Comments
The serve dependency fast-url-parser can be patched as a temporary measure. Starting with the following: mkdir serve-test
cd serve-test
npm init -y
npm install serve
export NODE_OPTIONS='--trace-deprecation'
npx serve -v WorkaroundUse npm module patch-package npm install patch-package add script to "postinstall": "patch-package" Edit Change var punycode = require("punycode"); to var punycode = require("punycode/"); then execute npx patch-package fast-url-parser To verify, execute again: npx serve -v There should be no deprecation message, even when running under Node.js For package managers other than npm, see README of patch-package. |
Should I execute the code on top |
You would replace |
Node.js 21 is now in maintenance and reached end-of-life on June 1, 2024. |
Description
Running
serve
under Node.js21.x
version causes the following deprecation notice to be displayed:The message is also shown in response to
serve -v
.Node.js v21.0.0 (Current) was released on Oct 17, 2023.
Steps to reproduce
shows
https://nodejs.org/dist/latest-v21.x/docs/api/deprecations.html#DEP0040 lists the deprecation and shows that a runtime deprecation was added to Node.js
v21.0.0
(see nodejs/node#47202).Library version
First reported on version:
14.2.1
Still reproducible with version:
14.2.2
Node version
v21.0.0v21.7.3
Related issues
punycode
is deprecated since Node.js 21 serve-handler#204punycode
is deprecated since Node.js 21 petkaantonov/urlparser#20. This is the repo corresponding to the npm module fast-url-parser implicated in the deprecation trace.The text was updated successfully, but these errors were encountered: