entering node --stack-size=10000 in the concsole/terminal
every time i try
A message confirming that i have set the new stack size limit? in any case not a request for input?
Welcome to Node.js v13.10.1.
Type ".help" for more 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_
@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.
Most helpful comment
@TheOneAndOnlyGarcia When you run
nodewithout 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-sizewith 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.)