Deprecation Warning: punycode module in AWS CDK logs #34012
Replies: 1 comment
-
@Sivakumar-CD AWS CDK officially supports and is tested with LTS versions like Node.js 20.x and 22.x. The warning you're seeing is due to the punycode module being deprecated in Node.js 7 and removed from the core in Node.js 17 and above, requiring an external package. Some deep dependencies (like ajv -> uri-js) still try to access the native punycode module. Until these dependencies are updated upstream, the most stable option is to use Node.js 20 or 22 (LTS) and install the punycode package (npm install punycode) or update dependencies like ajv and uri-js to versions that don't rely on the native punycode. You can switch with nvm: nvm install 22
nvm use 22 if it doesnt work, you can try to clean the cache/Modules, maybe you installed an old version
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Issue Description
I am using aws-cdk-lib and see the following deprecation warning in CloudWatch logs:
ERROR (node:9) [DEP0040] DeprecationWarning: The
punycode
module is deprecated. Please use a userland alternative instead.(Use
node --trace-deprecation ...
to show where the warning was created)yarn why punycode
, and the module is used byaws-cdk-lib
.punycode
in my code.Steps to Reproduce
Expected Behavior
Environment
Workaround
yarn upgrade aws-cdk-lib
), but the issue persists.Additional Context
punycode
module was deprecated in Node.js 7 and removed in Node.js 17.aws-cdk-lib
andajv -> uri-js -> punycode
.Could AWS CDK remove this deprecated dependency?
Beta Was this translation helpful? Give feedback.
All reactions