Can I get node --inspect to open Chrome automatically

前端 未结 9 1962
孤城傲影
孤城傲影 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:15

    There is a separate utility to do this called inspect-process, but no in built support.

    As far as I can see, the (C++) code that is starting the inspector and outputting that debug message is here:

    https://github.com/nodejs/node/blob/master/src/inspector_socket_server.cc

    Specifically the functions, InspectorSocketServer::Start, PrintDebuggerReadyMessage

    I don't see any feature to auto open a browser in this code (at the time of writing v7.4) but would suggest one of the following:

    1. open a feature request here https://github.com/nodejs/node/issues
    2. implement the feature yourself and submit a PR
    3. use inspect-process

提交回复
热议问题