Node: Increasing stack size with --stack-size in Node.js v13.10.1 opens REPL mode.

Created on 12 Mar 2020  路  2Comments  路  Source: nodejs/node

  • Version: v13.10.1
  • Platform: Darwin
  • Subsystem: unknown

What steps will reproduce the bug?

entering node --stack-size=10000 in the concsole/terminal

How often does it reproduce? Is there a required condition?

every time i try

What is the expected behavior?

A message confirming that i have set the new stack size limit? in any case not a request for input?

What do you see instead?

Welcome to Node.js v13.10.1. Type ".help" for more information.

Additional information

if i enter node --stack-size=10000 in the console the following message appears:

(base) andrea-iMac:app andrea$ node --stack-size=10000

Welcome to Node.js v13.10.1.
Type ".help" for more information.
> 

The command node --v8-options list the desired command as

...
  --stack-size (default size of stack region v8 is allowed to use (in kBytes))
        type: int  default: 984
...

_maybe it's not a bug, maybe I'm doing something wrong? any help is welcome! thank you_

cli question

Most helpful comment

@TheOneAndOnlyGarcia When you run node without a script, it enters REPL mode. That includes cases when you run Node.js with CLI options; As long as you don鈥檛 specify a script to run, the REPL is the default.

(Aside, you may or may not be aware of this, but often people try to use --stack-size with the intent to set the stack size; That鈥檚 not what it does. Rather, it tells V8 about how much of the stack it is allowed to use. Setting it to values that are larger than the actual stack may lead to crashes.)

All 2 comments

@TheOneAndOnlyGarcia When you run node without a script, it enters REPL mode. That includes cases when you run Node.js with CLI options; As long as you don鈥檛 specify a script to run, the REPL is the default.

(Aside, you may or may not be aware of this, but often people try to use --stack-size with the intent to set the stack size; That鈥檚 not what it does. Rather, it tells V8 about how much of the stack it is allowed to use. Setting it to values that are larger than the actual stack may lead to crashes.)

oh no, sometimes i overlook the easiest solution ->node --stack-size=10000 app.js
thanks a lot!

i am running some large calculations with node, it calculates tens of thousands of folds and sometimes simply takes a little longer, that's fine. setting the stack size now lets run my script without exception.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cong88 picture cong88  路  3Comments

vsemozhetbyt picture vsemozhetbyt  路  3Comments

stevenvachon picture stevenvachon  路  3Comments

willnwhite picture willnwhite  路  3Comments

dfahlander picture dfahlander  路  3Comments