Description
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:
- Add to
package.json
"overrides": {
"whatwg-url": "^14.1.0"
}
- Remove
package-lock.json
. npm install
npm shrinkwrap
- 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)
> npm ls clone-stats -g
+-- [email protected]
| `-- [email protected]
| `-- [email protected]
| `-- [email protected]
| `-- [email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
`-- [email protected]
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"
}
Metadata
Metadata
Assignees
Labels
No labels