What does the Node.js `--nolazy` flag mean?

后端 未结 5 896
無奈伤痛
無奈伤痛 2021-02-01 13:28

When I use --nolazy, I can finally debug asynchronously with IntelliJ, as breakpoints stop at the correct place. But I can\'t find any docs on --nolazy

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-01 13:42

    • Problem: when you want to set breakpoints in ides to debug js codes in nodejs, some breakpoints doesn't work.

    • Reason: On start, node parses the code lazily, it means it doesn't see the full code. so it doesn't see all of the breakpoint.

    • Solution: Use --no-lazy option to turn of the node's lazy behavior.

    ( Ps: i tried to explain it easily and it may not be so accurate. )

提交回复
热议问题