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

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

Closed
charliea21 opened this issue Jul 7, 2019 · 15 comments

Comments

@charliea21
Copy link

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
Copy link

Same here! With node v12.X

@nedkelly
Copy link

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

@benhjt
Copy link

benhjt commented Nov 11, 2019

Same problem running Node v12.13.0.

@victor-cano
Copy link

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
Copy link

Having the same issue. Any update?

@NeoDobby
Copy link

NeoDobby commented Apr 9, 2020

Same issue here ...

@sthompson732
Copy link

Same issue, Node v12.13.1

@andrey-reznik
Copy link

andrey-reznik commented Apr 22, 2020

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
Copy link

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
Copy link

xavokill commented May 22, 2020

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
Copy link

acflach commented Jul 8, 2020

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
Copy link

chengzhuo5 commented Aug 10, 2020

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
Copy link

Node.js 14.6 has fixed this problem.

@marklsl
Copy link

marklsl commented Oct 25, 2020

same problem

@marklsl
Copy link

marklsl commented Oct 25, 2020

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

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

No branches or pull requests