purple-hats icon indicating copy to clipboard operation
purple-hats copied to clipboard

I'm getting this error - The `punycode` module is deprecated. Please use a userland alternative instead.

Open mgifford opened this issue 6 months ago • 6 comments

[DEP0040] DeprecationWarning: The punycode module is deprecated. Please use a userland alternative instead. (Use node --trace-deprecation ... to show where the warning was created)

Probably not critical, but thought it might be good to address.

mgifford avatar Jan 25 '24 20:01 mgifford

Hi @mgifford,

I am not able to replicate the deprecation warning of punycode. I have deleted my node_modules folder and package-lock.json file and done npm install on both node v18.x.x and v20.11.0.

The issue you are facing might be due to a different version of node or other reasons.

younglim avatar Jan 31 '24 05:01 younglim

node v21.6.1

same issue as reported by @mgifford

npm ls punycode

├─┬ [email protected] │ └─┬ [email protected] │ └─┬ [email protected] │ └── [email protected] └─┬ [email protected] ├─┬ [email protected] │ └── [email protected] └─┬ [email protected] └─┬ [email protected] └── [email protected]

brianteeman avatar Mar 13 '24 22:03 brianteeman

Hi @brianteeman, are you able to show the full command-line? I am unable to replicate the issue:

Node version

young@youngs-MacBook-Pro purple-a11y % nvm use --lts    
Now using node v20.11.1 (npm v10.2.4)

npm install

young@youngs-MacBook-Pro purple-a11y % npm install
^R########⠂⠂⠂⠂⠂⠂⠂⠂⠂) ⠦ reify:@aashutoshrathi/word-wrap: sill audit bulk request
npm WARN deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm WARN deprecated [email protected]: Use your platform's native DOMException instead
npm WARN deprecated [email protected]: dommatrix is no longer maintained. Please use @thednp/dommatrix.

added 744 packages, and audited 745 packages in 8s

161 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Run scan with trace-deprecation

young@youngs-MacBook-Pro purple-a11y % node --trace-deprecation cli -u https://www.tech.gov.sg -p 1 -k "younglim:[email protected]" -c 2


 Purple A11y version: 0.9.46 
 Starting scan... 


┌────────────────────────────────────────┐
│ Scan Summary                           │
│                                        │
│ Must Fix: 2 issues / 7 occurrences     │
│ Good to Fix: 6 issues / 26 occurrences │
│ Needs Review: 0 issues / 0 occurrences │
│ Passed: 484 occurrences                │
└────────────────────────────────────────┘
┌─────────────────────────────────────────────────────────────────┐
│ Report of this run is at a11y-scan-results.zip                  │
│ Results directory is at results/20240314_101154_www.tech.gov.sg │
└─────────────────────────────────────────────────────────────────┘

younglim avatar Mar 14 '24 02:03 younglim

PS D:\repos\purple-a11y> git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
PS D:\repos\purple-a11y> npm install

up to date, audited 743 packages in 956ms

161 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
PS D:\repos\purple-a11y> npm ls punycode
@govtechsg/[email protected] D:\repos\purple-a11y
├─┬ [email protected]
│ └─┬ [email protected]
│   └─┬ [email protected]
│     └── [email protected] deduped
└─┬ [email protected]
  ├─┬ [email protected]
  │ └── [email protected]
  └─┬ [email protected]
    └─┬ [email protected]
      └── [email protected] deduped

PS D:\repos\purple-a11y> node index
┌────────────────────────────────────────────────────────────┐
│ Purple A11y (ver 0.9.46)                                   │
│ We recommend using Chrome browser for the best experience. │
└────────────────────────────────────────────────────────────┘
 To personalise your experience, we will be collecting your name, email address and app usage data.
 Your information fully complies with GovTech's Privacy Policy.
? Name: (node:28704) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)


PS D:\repos\purple-a11y> node --trace-deprecation index
┌────────────────────────────────────────────────────────────┐
│ Purple A11y (ver 0.9.46)                                   │
│ We recommend using Chrome browser for the best experience. │
└────────────────────────────────────────────────────────────┘
 To personalise your experience, we will be collecting your name, email address and app usage data.
 Your information fully complies with GovTech's Privacy Policy.
? Name: (node:36972) [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> (D:\repos\purple-a11y\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)

brianteeman avatar Mar 14 '24 08:03 brianteeman

Thanks, I have resolved the deprecation in https://github.com/GovTechSG/purple-a11y/commit/4f8518c5fe2c51a00f63fdb510c404007174887e. It will be effective in upcoming release.

younglim avatar May 17 '24 12:05 younglim

Great news

brianteeman avatar May 17 '24 12:05 brianteeman