Michel
Michel

Reputation: 11755

`punycode` module / deprecated

On a nextJS app, when running this command:

 % npm run build

I just got this message:

 ✓ Linting and checking validity of types    
 ✓ Collecting page data    
(node:2225) [DEP0040] DeprecationWarning: The `punycode` module is deprecated.
Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
   Generating static pages (0/6)  [=   ](node:2224) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland    alternative instead.

But punycode is not something I installed. Actually I don't know what it is.

I noticed it was present in my package-lock.json file; but was not aware of it before this.

I saw on the net that this issue has already appeared, but did not see any clear solution.

Is there any way to handle this problem ?

I could always try something like:

npm install punycode

But installing something that I don't need, or don't know why I need it feels somewhat weird.

Upvotes: 5

Views: 5906

Answers (3)

plzbugmenot
plzbugmenot

Reputation: 1

It's not an error. It's a warning. You can safely ignore it, although that package is not receiving updates, and it's not recommended for use in production.

You can check this link. https://github.com/orgs/nodejs/discussions/55774

Upvotes: 0

Blaq_2022
Blaq_2022

Reputation: 47

solution that worked for me: npm install punycode --save

and then in node_modules go to the directory tr46 > index.js

Replace this: const punycode = require('punycode'); With this: const punycode = require('punycode/');

basically just add a trailing forward slash

Upvotes: -3

Sevak Girard
Sevak Girard

Reputation: 1

I had the same issue. Wondering what this is or if you need it to run Nextjs 14 optimally.

Upvotes: -1

Related Questions