为什么这个WebStormconfiguration不允许我在节点应用程序中创build断点?

我试图debugging一个应用程序,它有一个后端和一个node.js前端。 我只用一个简单的bra run后端,它发出:

NFO[12-08|11:57:59] Initializing HTTP Server logger=http.server address=0.0.0.0:3000 protocol=http subUrl= socket=

然后我尝试在WebStorm中运行一个debugging会话,使用以下npmconfiguration:

在这里输入图像说明

当我开始debugging会话时输出以下内容:

 /usr/local/bin/node --inspect-brk /usr/local/lib/node_modules/npm/bin/npm-cli.js run watch --scripts-prepend-node-path=auto To debug the "watch" script, make sure the $NODE_DEBUG_OPTION string is specified as the first argument for the node command you'd like to debug. For example: "scripts": { "start": "node $NODE_DEBUG_OPTION server.js" } Debugger listening on ws://127.0.0.1:9229/7c6f9f1b-377e-4a07-b7f8-0155b0d59adb For help see https://nodejs.org/en/docs/inspector Debugger attached. 

所以我对通常的Web应用程序的debugging很新,但是我期望我现在可以打开我的浏览器到localhost:3000/my/script.js并且WebStorm的断点受到打击。 但情况并非如此; 我可以浏览我的应用程序(即使只使用文本bra run命令和debugging会话在WebStorm中未激活),但它不会在WebStorm中触发任何断点。 我也不完全确定ws://128.0.0.1:9229端点是干什么用的,但是我认为这与我为什么不能获得任何东西能够工作有关。

我一直在努力挣扎几个小时,而且我很困扰如何让应用程序运行,以便我可以使用WebStorm进行debugging。

有了这个configuration,你正在debuggingwatch npm脚本,而不是grafana服务的应用程序。 要debugging应用程序,您应该已经创build了一个JavaScriptdebugging运行configuration,指定localhost:3000作为URL。 请参阅https://www.jetbrains.com/help/webstorm/2017.3/debugging-javascript-in-chrome.htmldebugging在外部Web服务器上运行的应用程序