Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeprecationWarnings: punycode and clone-stats #844

Open
mnaoumov opened this issue Jan 20, 2025 · 1 comment · May be fixed by #845 or yeoman/generator#1586
Open

DeprecationWarnings: punycode and clone-stats #844

mnaoumov opened this issue Jan 20, 2025 · 1 comment · May be fixed by #845 or yeoman/generator#1586

Comments

@mnaoumov
Copy link

When you run yo for any generator on Node 22+, you always get DeprecationWarnings:

punycode

[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:399:7)
    at BuiltinModule.compileForPublicLoader (node:internal/bootstrap/realm:338:10)
    at loadBuiltinModule (node:internal/modules/helpers:108:7)
    at Module._load (node:internal/modules/cjs/loader:1099:17)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:217:24)
    at Module.require (node:internal/modules/cjs/loader:1339:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (path/to/global/npm/node_modules/generator-my-generator/node_modules/whatwg-url/lib/url-state-machine.js:2:18)
> npm ls whatwg-url -g
+-- [email protected]
| `-- [email protected]
|   `-- [email protected]
|     `-- @octokit/[email protected]
|       `-- @octokit/[email protected]
|         `-- @octokit/[email protected]
|           `-- [email protected]
|             `-- [email protected]

This warning you can work around in your generator:

  1. Add to package.json
"overrides": {
  "whatwg-url": "^14.1.0"
}
  1. Remove package-lock.json.
  2. npm install
  3. npm shrinkwrap
  4. Include npm-shrinkwrap.json to your package

But ideally yeoman-generator updates its own dependencies.

clone-stats

[DEP0180] DeprecationWarning: fs.Stats constructor is deprecated.
    at cloneStats (path/to/global/npm/node_modules/yo/node_modules/clone-stats/index.js:6:21)
    at File.clone (path/to/global/npm/node_modules/yo/node_modules/vinyl/index.js:135:23)
    at MemFsEditor._copySingle (path/to/global/npm/node_modules/generator-my-generator/node_modules/mem-fs-editor/dist/actions/copy.js:83:40)
    at path/to/global/npm/node_modules/generator-my-generator/node_modules/mem-fs-editor/dist/actions/copy.js:59:14
    at Array.forEach (<anonymous>)
    at MemFsEditor.copy (path/to/global/npm/node_modules/generator-my-generator/node_modules/mem-fs-editor/dist/actions/copy.js:54:11)
    at MemFsEditor.copyTpl (path/to/global/npm/node_modules/generator-my-generator/node_modules/mem-fs-editor/dist/actions/copy-tpl.js:16:10)
    at MyGenerator.writing (path/to/global/npm/node_modules/generator-my-generator/generators/app/index.js:5062:17)
    at async MyGenerator.executeTask (path/to/global/npm/node_modules/generator-my-generator/node_modules/yeoman-generator/dist/actions/lifecycle.js:258:13)
    at async runLoop.add.once (path/to/global/npm/node_modules/yo/node_modules/yeoman-environment/dist/environment-base.js:395:17)

Here I couldn't find any workarounds as the problematic dependency is called via yo CLI itself.

Probably this change in yo code would fix the problem:

"overrides": {
  "clone-stats": "npm:clone-stats-node22"
}
@mshima
Copy link
Member

mshima commented Jan 21, 2025

Please report in https://github.com/sindresorhus/github-username and https://github.com/gulpjs/vinyl before.
We need to evaluate the need of the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants