Closed MikeMcC399 closed 3 months ago
The issue is also reproducible with yarn add
npm install yarn@1.22.1 -g
mkdir yarn-test
cd yarn-test
yarn init -y
yarn add yarn
displays:
yarn add v1.22.1
info No lockfile found.
[1/4] Resolving packages...
β (node:15052) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
info Direct dependencies
ββ yarn@1.22.21
info All dependencies
ββ yarn@1.22.21
Done in 0.44s.
I also encountered this issue, leave the version here for reference.
Component | Version |
---|---|
Yarn (Classic) | v1.22.19 |
Node.js: | v21.2.0 |
@kayac-chang
Yarn (Classic) v1.22.19
has already been replaced by v1.22.21
, so any attention should be focussed on this latest version.
@MikeMcC399 can you send the output with --trace-deprecation
? I'm personally unable to reproduce it on my end.
@RDIL
The following is from WSL2 under Windows 11 with a virtual Ubuntu 22.04.3 environment and nvm as Node manager installed:
npm install yarn@latest -g
yarn -v
1.22.21
export NODE_OPTIONS='--trace-deprecation'
yarn info yarn description
yarn info v1.22.21
(node:2652) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
at node:punycode:3:9
at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:392:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:328:10)
at loadBuiltinModule (node:internal/modules/helpers:101:7)
at Module._load (node:internal/modules/cjs/loader:1001:17)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (/home/mike/.nvm/versions/node/v21.2.0/lib/node_modules/yarn/lib/v8-compile-cache.js:159:20)
at Object.<anonymous> (/home/mike/.nvm/versions/node/v21.2.0/lib/node_modules/yarn/lib/cli.js:56536:18)
at __webpack_require__ (/home/mike/.nvm/versions/node/v21.2.0/lib/node_modules/yarn/lib/cli.js:22:30)
at Object.<anonymous> (/home/mike/.nvm/versions/node/v21.2.0/lib/node_modules/yarn/lib/cli.js:71815:18)
π¦π Fast, reliable, and secure dependency management.
Done in 0.30s.
(node:15108) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created) . solve this isseu.
@Mahi12333 Mahi12333 can you help me with some problem?
root@str-bot01:/# NODE_OPTIONS='--trace-deprecation' yarn info yarn description
yarn info v1.22.21
(node:1975) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
at node:punycode:3:9
at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:392:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:328:10)
at loadBuiltinModule (node:internal/modules/helpers:101:7)
at Module._load (node:internal/modules/cjs/loader:1001:17)
at Module.require (node:internal/modules/cjs/loader:1235:19)
at require (/usr/local/lib/node_modules/yarn/lib/v8-compile-cache.js:159:20)
at Object.
I m facing same issue while running mongo, this issue resolved ?
@shashi-appgolive
I m facing same issue while running mongo, this issue resolved ?
If you are having a problem with mongo then you should probably be referring to their support system https://github.com/mongodb/mongo
@RDIL
Were you now able to reproduce? and if so, is there still an intention to fix the issue in Yarn Classic?
I m facing same issue while running mongo, this issue resolved ?
Hi @shashi-appgolive is your issues resolved ? I am also getting this on node 19.9.0 version and mongo 7
I m facing same issue while running mongo, this issue resolved ?
Hi @shashi-appgolive is your issues resolved ? I am also getting this on node 19.9.0 version and mongo 7
Nope! Using local docker with mongo image.
Is there solution to this issue because I can't find one:
(node:9272) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
I don't wan to reproduce it I need to solve it.
I'm seeing that the way to fix this punycode/userland issue in Node is to change const punycode = require('punycode');
to const punycode = require('punycode/');
. I have searched my VSCode file and don't even have the original const punycode
anywhere in my project. Where would I add this line of code?
@SeaForeEx
I'm seeing that the way to fix this punycode/userland issue in Node is to change
const punycode = require('punycode');
toconst punycode = require('punycode/');
. I have searched my VSCode file and don't even have the originalconst punycode
anywhere in my project. Where would I add this line of code?
If you don't have the problem directly in your own code, then the problem would be coming from a module you're using. This issue is about the deprecation caused by Yarn Classic itself. I don't believe that it is possible to patch Yarn as a workaround.
You should be able to see which module(s) have a deprecation issue if you execute:
export NODE_OPTIONS='--trace-deprecation'
yarn
If the deprecation is coming from somewhere else rather than Yarn, then you might be able to patch it. That would however be a subject for the module with the issue.
Fixed my issue, I was trying to do this in the Front End instead of the Back End, classic amateur move.
@MikeMcC399 yeah, I was able to reproduce, I have no idea why it's doing that. I'll try to look into it further.
Update: I spoke with the team, it looks like the cause was already identified and fixed, but has not been released yet.
Fixed my issue, I was trying to do this in the Front End instead of the Back End, classic amateur move.
Hi, how you fixed this issue, mine is still not fixed, showing this error in my every project.
Also still seeing this.
Here's my deprecation output:
β rm -rf node_modules yarn.lock
took 4s
β yarn cache clean
success Cleared cache.
β¨ Done in 6.47s.
β node -v
v20.11.0
β nvm use 21
β export NODE_OPTIONS='--trace-deprecation'
β yarn install
yarn install v1.22.21
info No lockfile found.
[1/4] π Resolving packages...
β (node:51023) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
at node:punycode:3:9
at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:397:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:333:10)
at loadBuiltinModule (node:internal/modules/helpers:101:7)
at Module._load (node:internal/modules/cjs/loader:1006:17)
at Module.require (node:internal/modules/cjs/loader:1237:19)
at require (/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/v8-compile-cache.js:159:20)
at Object.<anonymous> (/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/cli.js:56536:18)
at __webpack_require__ (/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/cli.js:22:30)
at Object.<anonymous> (/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/cli.js:71815:18)
warning @ava/babel > @babel/plugin-proposal-nullish-coalescing-operator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead.
warning @ava/babel > @babel/plugin-proposal-dynamic-import@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-dynamic-import instead.
warning @ava/babel > @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning @ava/babel > empower-core > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @ava/babel > babel-plugin-espower > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @ava/babel > babel-plugin-espower > call-matcher > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @ava/babel > babel-plugin-espower > espurify > core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.
warning @babel/plugin-proposal-class-properties@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead.
warning @babel/plugin-proposal-numeric-separator@7.18.6: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead.
warning @babel/plugin-proposal-object-rest-spread@7.20.7: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-object-rest-spread instead.
warning @babel/plugin-proposal-optional-chaining@7.21.0: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning @electron/rebuild > node-gyp > make-fetch-happen > cacache > @npmcli/move-file@2.0.1: This functionality has been moved to @npmcli/fs
[2/4] π Fetching packages...
error @ava/typescript@4.1.0: The engine "node" is incompatible with this module. Expected version "^14.19 || ^16.15 || ^18 || ^20". Got "21.6.0"
error Found incompatible module.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
took 45s π
@JJJ
Also still seeing this.
That is to be expected, since this issue is still open. It was however great to read https://github.com/yarnpkg/yarn/issues/9013#issuecomment-1888289602 which said:
Update: I spoke with the team, it looks like the cause was already identified and fixed, but has not been released yet.
so that leads me to believe that if we wait, then the fix will be released in a new patch of Yarn > v1.22.21
.
Here's my deprecation output: β (node:51023) [DEP0040] DeprecationWarning: The
punycode
module is deprecated. Please use a userland alternative instead. at node:punycode:3:9 at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:397:7) at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:333:10) at loadBuiltinModule (node:internal/modules/helpers:101:7) at Module._load (node:internal/modules/cjs/loader:1006:17) at Module.require (node:internal/modules/cjs/loader:1237:19) at require (/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/v8-compile-cache.js:159:20) at Object.(/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/cli.js:56536:18) at __webpack_require__ (/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/cli.js:22:30) at Object. (/opt/homebrew/Cellar/yarn/1.22.21/libexec/lib/cli.js:71815:18)
This is basically the same stack trace as I posted in https://github.com/yarnpkg/yarn/issues/9013#issuecomment-1823602528.
You then have warnings concerning @ava/babel which you would need to research in their repo. The same for the other similar warnings.
error @ava/typescript@4.1.0: The engine "node" is incompatible with this module. Expected version "^14.19 || ^16.15 || ^18 || ^20". Got "21.6.0" error Found incompatible module.
This error from @ava/typescript says that it is not compatible with Node.js 21
. It may prevent your migration to Node.js 21
, however this is not a problem that Yarn can help you with.
Facing same issue, is there any update on this?
@basiq-ash
Facing same issue, is there any update on this?
The last update is from last week. See https://github.com/yarnpkg/yarn/issues/9013#issuecomment-1888289602
The issue is also reproducible if Yarn Classic is used to set the version to Yarn Modern:
nvm use 21
corepack disable
npm install yarn -g
yarn set version stable
$ yarn set version stable
(node:30812) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
β€ YN0000: Retrieving https://repo.yarnpkg.com/4.0.2/packages/yarnpkg-cli/bin/yarn.js
β€ YN0000: Saving the new release in .yarn/releases/yarn-4.0.2.cjs
β€ YN0000: Done in 0s 615ms
The issue is reproducible using npm run serve
.
I'm on: OS: Ubuntu 20.04.6 LTS on Windows 10 x86_64 Kernel: 5.15.133.1-microsoft-standard-WSL2
npm --version 10.3.0
node --version v21.6.1
(node:47931) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) ERROR TypeError: Function.prototype.apply was called on undefined, which is a undefined and not a function
I am not using a reference in my code.
@noxidsoft
npm run serve
Your comment is in the wrong repository, since this issue is about Yarn, not npm, and the problem with the npm module serve is caused by one of its dependencies. It is not caused by Yarn (which you are not using).
I m facing same issue
Component | Version |
---|---|
Yarn (Classic) | v1.22.19 |
Node.js: | v21.6.1 |
Facing the same issue, is there any update on this?
same issue
same here
same here
If you want to register that you are also interested in a resolution for this issue, I suggest you "up-vote" it by clicking on the ππ» icon in the original post https://github.com/yarnpkg/yarn/issues/9013#issue-1996377374 instead of adding a separate new comment:
@RDIL
You wrote in https://github.com/yarnpkg/yarn/issues/9013#issuecomment-1888289602 back in January that the issue was fixed and not yet released. Can you share any planning date for a potential release?
I don't honestly know. It's not up to me, and Yarn Classic is deprecated in favor of Berry, and is currently only getting high priority updates. I understand that it's not possible in all cases but I highly recommend migrating if you are able.
I'll try to bump this again but I can't guarantee anything.
@RDIL
Many thanks for your attention to this! I do appreciate that Yarn Classic is deprecated and in terms of using Yarn Classic as a standalone item I would understand if this issue were designated as "won't fix".
I would be more concerned about the use of Yarn Classic in order to set up Yarn Berry (Modern) which provokes the punycode
warning. Perhaps this is then more of an issue which needs to be transferred to Yarn Berry?
https://yarnpkg.com/getting-started/install says
The preferred way to manage Yarn is by-project and through Corepack, a tool shipped by default with Node.js. Modern releases of Yarn aren't meant to be installed globally, or from npm.
This is however slightly problematic as Node.js Corepack documentation classifies Corepack with Stability: 1 Experimental and the Node.js documentation says "Use of the feature is not recommended in production environments."
So the choice is between the devil and the deep-blue sea in Node.js 21
environments:
punycode
deprecation warningpunycode
deprecation warning, but at the cost of using the Corepack function which is not recommended for production useI'm writing with some solana spl token, and faced this issue,too.
(node:10501) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Oops, something went wrong: TokenAccountNotFoundError
@JhiNResH
Did you run your command using the --trace-deprecation
option to check which module(s) cause the warning?
@JhiNResH
Did you run your command using the
--trace-deprecation
option to check which module(s) cause the warning?
It did not show any modules that cause the warning
@JhiNResH same here.
Still getting the error on 21.6.2
Same here! Node 21.6.2
(node:46025) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
at node:punycode:3:9
at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:397:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:333:10)
at loadBuiltinModule (node:internal/modules/helpers:101:7)
at Module._load (node:internal/modules/cjs/loader:1006:17)
at Module.require (node:internal/modules/cjs/loader:1237:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/Users/clem/dev/wip-telegram-timeline/node_modules/psl/index.js:5:16)
at Module._compile (node:internal/modules/cjs/loader:1378:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
at Module.load (node:internal/modules/cjs/loader:1212:32)
at Module._load (node:internal/modules/cjs/loader:1028:12)
at Module.require (node:internal/modules/cjs/loader:1237:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/Users/clem/dev/wip-telegram-timeline/node_modules/tough-cookie/lib/pubsuffix-psl.js:32:11)
at Module._compile (node:internal/modules/cjs/loader:1378:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1437:10)
at Module.load (node:internal/modules/cjs/loader:1212:32)
at Module._load (node:internal/modules/cjs/loader:1028:12)
at Module.require (node:internal/modules/cjs/loader:1237:19)
at require (node:internal/modules/helpers:176:18)
at Object.<anonymous> (/Users/clem/dev/wip-telegram-timeline/node_modules/tough-cookie/lib/cookie.js:35:17)
@cba85
Your deprecation trace shows also warnings associated with
Those warnings are off topic for this issue however.
@cba85
Your deprecation trace shows also warnings associated with
- punycode is deprecated in Node v21Β lupomontero/psl#315
- Replace
psl
withtldts
Β salesforce/tough-cookie#346Those warnings are off topic for this issue however.
Thank you, I will check those links π
Fixed with the 1.22.22:
β― corepack yarn@1.22.21 info
yarn info v1.22.21
(node:35285) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
error Received invalid response from npm.
β¨ Done in 0.80s.
β― corepack yarn@1.22.22 info
yarn info v1.22.22
error Received invalid response from npm.
β¨ Done in 0.09s.
Fixed with the 1.22.22:
β― corepack yarn@1.22.21 info yarn info v1.22.21 (node:35285) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead. (Use `node --trace-deprecation ...` to show where the warning was created) error Received invalid response from npm. β¨ Done in 0.80s. β― corepack yarn@1.22.22 info yarn info v1.22.22 error Received invalid response from npm. β¨ Done in 0.09s.
What is the easiest way to test this fix?
@arcanis Many thanks for releasing this fix! ππ»
Testing according to the original repro steps confirms the fix is working as needed: π
Confirm that Node.js 21.x is installed / active
$ node -v
v21.7.1
Install previous version of Yarn (1.22.21
) and confirm that the deprecation warning appears:
$ npm install yarn@1.22.21 -g
added 1 package in 959ms
$ yarn info yarn description
yarn info v1.22.21
(node:25088) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
π¦π Fast, reliable, and secure dependency management.
Done in 0.21s.
Install latest version of Yarn (1.22.22
) and confirm that the deprecation warning no longer appears
$ npm install yarn@latest -g
changed 1 package in 459ms
$ yarn info yarn description
yarn info v1.22.22
π¦π Fast, reliable, and secure dependency management.
Done in 0.20s.
Also confirmed fixed for yarn set version stable
with corepack
disabled:
Confirm that Node.js 21.x is installed / active
$ node -v
v21.7.1
Install previous version of Yarn (1.22.21
) and confirm that the deprecation warning appears:
$ corepack disable
$ npm install yarn@1.22.21 -g
changed 1 package in 604ms
mikem@DESKTOP-J2IBBHJ MINGW64 /d/github2/yarn-install
$ yarn set version stable
(node:7044) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
β€ YN0000: You don't seem to have Corepack enabled; we'll have to rely on yarnPath instead
β€ YN0000: Downloading https://repo.yarnpkg.com/4.1.1/packages/yarnpkg-cli/bin/yarn.js
β€ YN0000: Saving the new release in .yarn/releases/yarn-4.1.1.cjs
β€ YN0000: Done with warnings in 0s 252ms
Install latest version of Yarn (1.22.22
) and confirm that the deprecation warning no longer appears
$ npm install yarn@latest -g
changed 1 package in 440ms
mikem@DESKTOP-J2IBBHJ MINGW64 /d/github2/yarn-install
$ yarn set version stable
β€ YN0000: Downloading https://repo.yarnpkg.com/4.1.1/packages/yarnpkg-cli/bin/yarn.js
β€ YN0000: Saving the new release in .yarn/releases/yarn-4.1.1.cjs
β€ YN0000: Done in 0s 459ms
@dmz006
What is the easiest way to test this fix?
See my previous comments https://github.com/yarnpkg/yarn/issues/9013#issuecomment-1987106314 and https://github.com/yarnpkg/yarn/issues/9013#issuecomment-1987108485
That does not cover all possible scenarios, however I'm confident that the issue has been fixed now as far as core Yarn is concerned.
@arcanis Many thanks for releasing this fix! ππ»
Testing according to the original repro steps confirms the fix is working as needed: π
Repro steps
Confirm that Node.js 21.x is installed / active ... Install previous version of Yarn (
1.22.21
) and confirm that the deprecation warning appears: $ npm install yarn@1.22.21 -g ... Install latest version of Yarn (1.22.22
) and confirm that the deprecation warning no longer appears ... $ npm install yarn@latest -g
@MikeMcC399 Thanks for the steps to reproduce.
I followed these steps, but still getting a punycode DeprecationWarning message.
@bennettfrazier
The most likely reason that you are still getting a punycode deprecation message is that it is coming from a package which is not Yarn. Have you set the environment variable
export NODE_OPTIONS='--trace-deprecation'
(or similar depending on your operating system and terminal type)
and run your command to get trace information?
@MikeMcC399
I use node: v21.6.2
and yarn: 1.22.22
.
Then I ran building NextJS v.14.2.1
with yarn build
with --trace-deprecation
Here is the result:
(node:24279) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
at node:punycode:3:9
at BuiltinModule.compileForInternalLoader (node:internal/bootstrap/realm:397:7)
at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:333:10)
at loadBuiltinModule (node:internal/modules/helpers:101:7)
at Module._load (node:internal/modules/cjs/loader:1006:17)
at Module.require (node:internal/modules/cjs/loader:1237:19)
at mod.require (/home/UserOne/Desktop/next-test/node_modules/next/dist/server/require-hook.js:65:28)
at require (node:internal/modules/helpers:176:18)
at 477 (/home/UserOne/Desktop/next-test/node_modules/next/dist/compiled/node-fetch/index.js:1:104564)
at __nccwpck_require__ (/home/UserOne/Desktop/next-test/node_modules/next/dist/compiled/node-fetch/index.js:1:453905)
Description
provokes a deprecation warning under Node.js current version
21.x
.Versions
v21.2.0v21.6.2Steps to reproduce
With Node.js
v21.2.0v21.6.2 installed, execute:shows
Further debug information is output by: