OP Here

Since --trace-warnings and --trace-deprecation didn't show a stacktrace, I found another way that did:

process.on('warning', (warning) => {
    console.log(warning.stack);
});
Answer from mateos on Stack Overflow
Discussions

DeprecationWarning when running `npm create astro@latest` with node v24.5.0
Astro Info Astro v5.12.9 Node v24.5.0 System macOS (arm64) Package Manager npm Output static Adapter none Integrations none If this issue only occurs in one browser, which browser is a problem? No ... More on github.com
🌐 github.com
1
August 12, 2025
Showing deprecation warning in console after upgrading to nodejs v24 lts [DEP0190]
Is there an existing issue for this? I have searched the existing issues Current behavior After upgrading to nodejs v24.11.1 lts, a warning appeared in console when i ran app using yarn start:dev t... More on github.com
🌐 github.com
1
November 19, 2025
(node:32799) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) - Serverless Framework - Serverless Forums
? (node:32799) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) Node version - v22.6.0 Framework Core: 3.38.0 (local) 3.38.0 (global) Plugin: 7.2.2 SDK: 4.5.1 ... More on forum.serverless.com
🌐 forum.serverless.com
0
September 16, 2024
Deprecation Warning After Node Update
Version v22.9.0 Platform No response Subsystem No response What steps will reproduce the bug? Update Node to v22.9.0. Run the command: dev": "nodemon src/index.js. How often does it repro... More on github.com
🌐 github.com
2
September 21, 2024
🌐
Reddit
reddit.com › r/nextjs › (use `node --trace-deprecation ...` to show where the warning was created) (node:27474) [dep0040] deprecationwarning: the `punycode` module is deprecated. please use a userland alternative instead.
r/nextjs on Reddit: (Use `node --trace-deprecation ...` to show where the warning was created) (node:27474) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
December 29, 2023 -

i keep getting this error in my server . I tried to reinstall node_modules but nothing happened .Any idea how to remove this?

"dependencies": {
"autoprefixer": "^10.4.14",
"bcrypt": "^5.1.1",
"bson": "^6.2.0",
"cloudinary": "^1.41.1",
"date-fns": "^2.30.0",
"dotenv": "^16.3.1",
"eslint-config-next": "^14.0.4",
"framer-motion": "^10.16.16",
"jsonwebtoken": "^9.0.2",
"leaflet": "^1.9.4",
"mongodb": "^6.3.0",
"mongoose": "^7.6.7",
"next": "^14.0.4",
"next-auth": "^4.24.5",
"nodemailer": "^6.9.7",
"postcss": "^8.4.27",
"react": "^18.2.0",
"react-date-range": "^1.4.0",
"react-dom": "^18.2.0",
"react-icons": "^4.12.0",
"react-leaflet": "^4.2.1",
"tailwindcss": "^3.3.3",
"uuid": "^9.0.1"
}

🌐
Stefan Judis
stefanjudis.com › today-i-learned › deprecate-method-in-node-js
How to "officially" deprecate methods with Node.js utilities | Stefan Judis Web Development
November 15, 2025 - $ node index.ts something (node:21682) DeprecationWarning: watch out! something is deprecated! (Use `node --trace-deprecation ...` to show where the warning was created)
🌐
Julianburr
julianburr.de › til › trace-deprecation-option-in-node
Today I learned: trace deprecation option in node — Julian Burr
April 9, 2019 - # e.g. before myscript build # ^ throws a bunch of deprecation warnings node --trace-deprecation myscript build # ^ still throws the warnings, but now includes stack traces for them · You can even activate it within your node script, by setting the following process variable, simply utilising nodes internal deprecation mechanisms:
🌐
GitHub
github.com › vercel › next.js › discussions › 66289
How to fix DeprecationWarning: punycode is deprecated · vercel/next.js · Discussion #66289
(Use node --trace-deprecation ... to show where the warning was created) ○ Compiling / ... (node:14572) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
Author: vercel
🌐
GitHub
github.com › withastro › astro › issues › 14214
DeprecationWarning when running `npm create astro@latest` with node v24.5.0 · Issue #14214 · withastro/astro
August 12, 2025 - ./extinct-equator(node:94325) [DEP0187] DeprecationWarning: Passing invalid argument types to fs.existsSync is deprecated (Use `node --trace-deprecation ...` to show where the warning was created)
Author: withastro
🌐
GitHub
github.com › nestjs › nest › issues › 15943
Showing deprecation warning in console after upgrading to nodejs v24 lts [DEP0190] · Issue #15943 · nestjs/nest
November 19, 2025 - (node:22161) [DEP0190] DeprecationWarning: Passing args to a child process with shell option true can lead to security vulnerabilities, as the arguments are not escaped, only concatenated. (Use `node --trace-deprecation ...` to show where the warning was created)
Author: nestjs
Find elsewhere
🌐
NodeSource
nodesource.com › blog › diagnostics-in-NodeJS-1
Diagnostics in Node.js Part 1/3
April 1, 2020 - You can also use the flag --trace-warnings, which will give you the stack trace of where the warning is coming from whenever you encounter a warning. The following is an example using buffers: This warning is showing something that might not work in the future: a deprecation warning.
🌐
Medium
medium.com › @asimabas96 › solving-the-punycode-module-is-deprecated-issue-in-node-js-93437637948a
Solving the “Punycode Module is Deprecated” Issue in Node.js | by Asimabas | Medium
August 23, 2024 - While working on the profile creation feature in the application, I encountered a 502 Bad Gateway error. After checking my server logs on AWS EC2, I found this warning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created)
🌐
Serverless Forums
forum.serverless.com › serverless framework
(node:32799) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) - Serverless Framework - Serverless Forums
September 16, 2024 - Hi Team, Did anyone recently saw below deprecation message on severless deploy, and know how to resolve this. ? (node:32799) [DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created) Node version - v22.6.0 Framework Core: 3.38.0 (local) 3.38.0 (global) Plugin: 7.2.2 SDK: 4.5.1 Thanks Rahul
🌐
Paulleasure
paulleasure.com › how-to › node-js-development-with-nodemon-and-node-trace-warnings
Node.js Development with `nodemon and node –trace-warnings` – Paul K Leasure
April 12, 2024 - The --trace-warnings flag is a powerful feature when running your Node.js applications as it prints detailed stack traces for these warnings. This detail includes the specific line and file where the warning was triggered, helping you quickly identify and address the issue.
🌐
GitHub
github.com › nodejs › node › issues › 55046
Deprecation Warning After Node Update · Issue #55046 · nodejs/node
September 21, 2024 - Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created)
Author: nodejs
🌐
TutorialsPoint
tutorialspoint.com › node-js-process-tracedeprecation-method
Node.js - process.traceDeprecation() Method
This process.traceDeprecation() method states whether the --trace-deprecation flag is set or not on the current Node.js project. This Boolean flag controls whether the trace of deprecation warning messages are pri
🌐
GitHub
github.com › forcedotcom › cli › issues › 3094
Node js deprecation warning coming along with sf org login command · Issue #3094 · forcedotcom/cli
November 4, 2024 - (node:37) Warning: Closing file descriptor 23 on garbage collection (Use `node --trace-warnings ...` to show where the warning was created) (node:37) [DEP0137] DeprecationWarning: Closing a FileHandle object on garbage collection is deprecated.
Author: forcedotcom
🌐
GitHub
github.com › nodejs › node › commit › 1092bb94f4
process: suggest --trace-warnings when printing warning · nodejs/node@1092bb9
April 17, 2020 - const flag = isDeprecation ? '--trace-deprecation' : '--trace-warnings'; 84 · + const argv0 = require('path').basename(process.argv0 || 'node', '.exe'); 85 · + msg += `\n(Use \`${argv0} ${flag} ...\` to show where the warning ` + 86 · + 'was created)'; 87 ·
Author: nodejs
🌐
Jamovi
forum.jamovi.org › board index › development › jamovi development
Deprecation warning when compiling a module with current R - jamovi
June 26, 2025 - Using the current R version (4.5.1), ... of './lib/po2json'. Please either fix that or report it to the module author (Use `node --trace-deprecation ...` to show where the warning was created) (If it should be helpful, I am happy to share my Jamovi module code....
🌐
GeeksforGeeks
geeksforgeeks.org › node.js › node-js-process-tracedeprecation-property
Node.js process.traceDeprecation Property - GeeksforGeeks
June 10, 2021 - Return Value: This property indicates whether the --trace-deprecation flag is set on the current Node.js process.
🌐
Reddit
reddit.com › r/nextjs › warnings when create default next.js project
r/nextjs on Reddit: Warnings when create default Next.js project
May 18, 2024 -

On Macos, Node v22.2.0, I create a project with

npx create-next-app@latest

And the default options. I then run npm i... and npm run dev and access the homepage.

I get the following warnings

~/nextjs-test  npm run dev  ✔

▲ Next.js 14.2.3

✓ Starting...

✓ Ready in 3.6s

(node:47681) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.

(Use `node --trace-deprecation ...` to show where the warning was created)

○ Compiling / ...

(node:47681) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.

The first one seems to be linked to eslint
The second one can disappear if I remove the import of global.css

Any idea how to fix this?

Here is the repository if needed

Github