yeoman / generator-generator

Generate a Yeoman generator
1.22k stars 237 forks source link

(node:24532) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated #234

Closed charliea21 closed 3 years ago

charliea21 commented 5 years ago

When I choose my generator name (or just press ENTER/RETURN for default) for yo generator I get a deprecation error then Yeoman stops working...

(node:24532) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

daniel-alonso-sanchez commented 4 years ago

Same here! With node v12.X

nedkelly commented 4 years ago

I have the same problem, nothing executes after this message.

benhjt commented 4 years ago

Same problem running Node v12.13.0.

victor-cano commented 4 years ago

Same issue, tested using Node v13.8.0, 12.16.1, 10.19.0; on Windows 10, it's get stuck after asking for the generator name.

ErraticFox commented 4 years ago

Having the same issue. Any update?

NeoDobby commented 4 years ago

Same issue here ...

sthompson732 commented 4 years ago

Same issue, Node v12.13.1

andrey-reznik commented 4 years ago

Same issue, Node v12.16.2 But I found a solution, need to run yo manually with the following command: node --no-deprecation <global_node_modules_path>\npm\node_modules\yo\lib\cli.js <generator or command> Example for Windows PowerShell: node --no-deprecation "$env:APPDATA\npm\node_modules\yo\lib\cli.js" generator

betterRunner commented 4 years ago

Same issue, Node v12.16.2 But I found a solution, need to run yo manually with the following command: node --no-deprecation <global_node_modules_path>\npm\node_modules\yo\lib\cli.js <generator or command> Example for Windows PowerShell: node --no-deprecation "$env:APPDATA\npm\node_modules\yo\lib\cli.js" generator

this doesn't work for me, but I hack it by just commenting the code of askName: your npm location/generator-generator/app/index.js

  prompting() {
    // return askName({
    //   name: 'name',
    //   message: 'Your generator name',
    //   default: makeGeneratorName(path.basename(process.cwd())),
    //   filter: makeGeneratorName,
    //   validate: str => {
    //     return str.length > 'generator-'.length;
    //   }
    // }, this).then(props => {
    //   this.props.name = props.name;
    // });
    this.props.name = 'generator-project'
  }
xavokill commented 4 years ago

I don't have the same error as @charliea21, but i was able to use the same "hack" as @betterRunner already explained, and it worked!!!

if it is useful, i'm running Node v12.16.3

This is the error: (node:2464) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated

acflach commented 3 years ago

I have the same problem . . . Node v12.18.1, npm 6.14.5, Windows 10 Pro 2004.

The solution above presented by @andrey-reznik does not work for me, only deletes the deprecation message and the yo hangs.

I am traying to modify the code . . .

chengzhuo5 commented 3 years ago

This is a bug in win10 that readline.closed can cause freeze when readline.createInterface({ terminal: true }) Adding a hook in AppData\Roaming\npm\node_modules\yo\node_modules\yeoman-environment\node_modules\inquirer\lib\ui\baseUI.js can solve this problem:

var readline = require('readline');
const oldClose = readline.Interface.prototype.close
readline.Interface.prototype.close = function () {
  this.terminal = false // set terminal to false before close
  oldClose.call(this)
};
chengzhuo5 commented 3 years ago

Node.js 14.6 has fixed this problem.

marklsl commented 3 years ago

same problem

marklsl commented 3 years ago

The solution is to first initialize the package.json using:yarn init