admin管理员组文章数量:1313787
Trying to debug an NPM script from within Webstorm. The application runs through the NPM scripts, but when debugging the script it always crashes. I know that there is the flag $NODE_DEBUG_OPTION
, but adding that doesn't seem to work.
Script:
"dev": "npm run dev:server & npm run build:client:watch",
"dev:server": "npm run build:server:watch & nodemon --harmony lib/server",
"build:client:watch": "WEBPACK_DEV=true NODE_ENV=development STACK=local node lib/server/webpack",
"build:server:watch": "npm run transpile:watch -- -d lib/mon src/mon & npm run transpile:watch -- -d lib/server src/server",
"transpile": "BABEL_ENV=node babel",
"transpile:watch": "npm run transpile -- --watch",
According to Webstorm: To debug the "dev" script, make sure the $NODE_DEBUG_OPTION string is specified as the first argument for the node mand you'd like to debug. For example: { "start": "node $NODE_DEBUG_OPTION server.js" }
But even when adding this in different places it will still give me an error. Any suggestions?
Trying to debug an NPM script from within Webstorm. The application runs through the NPM scripts, but when debugging the script it always crashes. I know that there is the flag $NODE_DEBUG_OPTION
, but adding that doesn't seem to work.
Script:
"dev": "npm run dev:server & npm run build:client:watch",
"dev:server": "npm run build:server:watch & nodemon --harmony lib/server",
"build:client:watch": "WEBPACK_DEV=true NODE_ENV=development STACK=local node lib/server/webpack",
"build:server:watch": "npm run transpile:watch -- -d lib/mon src/mon & npm run transpile:watch -- -d lib/server src/server",
"transpile": "BABEL_ENV=node babel",
"transpile:watch": "npm run transpile -- --watch",
According to Webstorm: To debug the "dev" script, make sure the $NODE_DEBUG_OPTION string is specified as the first argument for the node mand you'd like to debug. For example: { "start": "node $NODE_DEBUG_OPTION server.js" }
But even when adding this in different places it will still give me an error. Any suggestions?
Share Improve this question asked Jun 22, 2017 at 21:05 JmrappJmrapp 5204 silver badges14 bronze badges2 Answers
Reset to default 8For anyone reading this in 2020, you just need to right-click the script in the NPM panel and select "Debug ".
You can then set breakpoints in the script and debug in the Debug panel panes, Debugger, Console, etc..
To re-run the script, click the bug icon in the Debug panel.
Probably you are using node8, where this will not work because in node 8 V8 debugger API had been superseded by the V8 inspector API. For more info look at this issue, In previous versions of nodejs this works. For node 8 you should check the WebStorm site, they have information about how to work with the new inspector protocol https://www.jetbrains./help/webstorm/run-debug-configuration-node-js.html?search=node
本文标签: javascriptWebstorm Debugging NPM Script Through IDEStack Overflow
版权声明:本文标题:javascript - Webstorm Debugging NPM Script Through IDE - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741955733a2406977.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论