node.js REPL “undefined”

前端 未结 4 1710
醉梦人生
醉梦人生 2020-12-03 05:48

Upgraded from node 0.4.11 to 0.6.15, and noticed the REPL (running node with no arguments) keeps dumping \"undefined\" after most commands or carriages returns...

It

4条回答
  •  渐次进展
    2020-12-03 06:19

    On similar lines of this answer

    You can run this repl.repl.ignoreUndefined=true from inside REPL session.

    A sample code:

    Welcome to Node.js v12.13.1.
    Type ".help" for more information.
    > var x
    undefined
    > repl.repl.ignoreUndefined=true
    true
    > var y = 10
    > _
    true
    > console.log(y)
    10
    >
    

提交回复
热议问题