cypress-io / cypress

Fast, easy and reliable testing for anything that runs in a browser.
https://cypress.io
MIT License
46.77k stars 3.16k forks source link

cypress install causes node 22 `punycode` deprecation #29774

Open MikeMcC399 opened 3 months ago

MikeMcC399 commented 3 months ago

Current behavior

Executing

cypress install

causes a deprecation warning when run under Node.js 22

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

Desired behavior

Executing

cypress install

should not show any deprecation warning when run under any supported version of Node.js, including 22.x.

Test code to reproduce

mkdir cy-test
cd cy-test
git init
npm init -y
npm install cypress -D
npx cypress install

Cypress Version

First reported on version: 13.12.0 Reproducible also on: 13.15.0

Node version

v22.3.0 v22.9.0

Operating System

Ubuntu 22.04.4 LTS

Debug Logs

$ export NODE_OPTIONS='--trace-deprecation'
npx cypress install
(node:3719) [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:398:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:337:10)
    at loadBuiltinModule (node:internal/modules/helpers:96:7)
    at Module._load (node:internal/modules/cjs/loader:1063:17)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16)
    at Object.<anonymous> (/home/mike/github/tmp/cy-test/node_modules/psl/index.js:5:16)
    at Module._compile (node:internal/modules/cjs/loader:1460:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1544:10)
    at Module.load (node:internal/modules/cjs/loader:1275:32)
    at Module._load (node:internal/modules/cjs/loader:1091:12)
    at wrapModuleLoad (node:internal/modules/cjs/loader:212:19)
    at Module.require (node:internal/modules/cjs/loader:1297:12)
    at require (node:internal/modules/helpers:123:16)

Cypress 13.12.0 is installed in /home/mike/.cache/Cypress/13.12.0

Skipping installation:

  Pass the --force option if you'd like to reinstall anyway.

...

$ npm ls psl
cy-test@1.0.0 /home/mike/github/tmp/cy-test
└─┬ cypress@13.12.0
  └─┬ @cypress/request@3.0.1
    └─┬ tough-cookie@4.1.4
      └── psl@1.9.0

Other

This issue is related to

MikeMcC399 commented 5 days ago

tough-cookie@5.0.0 resolves this issue, however there has been no update made to @cypress/request yet to use this fixed version:

cy-test@1.0.0 
└─┬ cypress@13.14.2
  └─┬ @cypress/request@3.0.5
    └─┬ tough-cookie@4.1.4
      └── psl@1.9.0
MikeMcC399 commented 1 day ago

Node.js 22.x is planned for active LTS status starting Oct 29, 2024.