Question: Debugging and npm scripts
See original GitHub issueI’m looking for a way to run some npm scripts in Visual Studio Code (to lint/build/etc), then run, say, jasmine
in debug mode from VSCode.
Currently to debug my tests, I have to:
npm run build_stuff
jasmine
I’d like to run the npm run build_stuff out of debug mode, then debug jasmine
, which is running specs in my project.
Is it the intent of this extension to help support that use case?
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
What is the proper way to debug an npm script using vscode?
1. Possible duplicate of How to debug using npm run scripts from VSCode? – Jakub Synowiec · Agreed at duplicate, and I recommend...
Read more >Debug Node.js Apps using Visual Studio Code
The Visual Studio Code editor includes Node.js debugging support. Set breakpoints, step-in, inspect variables and more.
Read more >Cannot run npm scripts for debugging. · Issue #152613 - GitHub
Issue Type: Bug Open a node.js project in the NPM script bar in the explorer, click the debug button Result: Instead of starting...
Read more >Prompt to "Terminate Batch Job" when debugging NPM scripts ...
Prompt to "Terminate Batch Job" when debugging NPM scripts if using NPM binary as a package manager. When stop "run" command Webstrom now...
Read more >How to Debug Node.js Code Using Multiple Tools - Kinsta
Use Node.js Command Line Options · --check syntax check the script without executing · --trace-warnings output a stack trace when JavaScript ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
How about you leave your build process as is, but once a test fails then you run tests under the debugger. To do so you can define a launch configuration as follows:
node
from the quick boxIf you always want to run the tests under the debugger then you could do what is described in this blog for debugging mocha tests, that is, you launch the tests and attach the debugger.
The configuration Erich suggested works fine for me. Thanks!
I do as well debug other gulp tasks this way by adding new launch.js configurations this way:
"program": "${workspaceRoot}/node_modules/gulp/bin/gulp.js"
"args": [ "jasmine" ]