Can I get node --inspect to open Chrome automatically

前端 未结 9 1988
孤城傲影
孤城傲影 2020-12-13 03:41

In the new versions of node, node-inspector is built in and can be fired using the command node --inspect index.js. However, this always provides a command line

9条回答
  •  孤街浪徒
    2020-12-13 04:22

    This is not possible, for multiple reasons.

    1. Starting the Chrome (or other "desktop" application) is platform dependent. Core Node can't do it and it would add unnecessary complexity (e.g. think about discovering the install location, dealing with Chrome not installed, etc).
    2. This would tie Node to Chrome, which is not desirable.
    3. Chrome does not provide a way to pass devtools URL from the command line.

提交回复
热议问题