Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't launch debug target via npm #12737

Closed
dbaeumer opened this issue Sep 27, 2016 · 5 comments
Closed

Can't launch debug target via npm #12737

dbaeumer opened this issue Sep 27, 2016 · 5 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@dbaeumer
Copy link
Member

  • VSCode Version: 1.6.0-Insider
  • OS Version: Windows 10

Steps to Reproduce:

  1. Follow the steps in Test launch option that allows run node project by npm script #12253
  2. Try to launch. I get

capture

  1. Running npm run debug from the terminal works as expected.

capture

I use nvm to manage my node installs. Don't know if this makes a difference.

@dbaeumer dbaeumer added bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues labels Sep 27, 2016
@roblourens
Copy link
Member

Works on OSX but not Windows. Workaround - change your runtimeExecutable to "npm.cmd" on Windows.

@roblourens
Copy link
Member

I guess in general this won't work if your runtimeExecutable is a .bat/.cmd and you don't include the extension.

@weinand weinand added this to the October 2016 milestone Oct 10, 2016
@weinand
Copy link
Contributor

weinand commented Oct 10, 2016

The problem is that on Windows both a 'npm' and a 'npm.cmd' exist on the PATH but only the latter actually works on Windows whereas the former is a shell script for linux/macOS. If a launch config specifies npm, VS Code will use the npm shell script which silently fails on Windows.
I've added this to the release notes.

@weinand weinand modified the milestones: November 2016, October 2016 Oct 21, 2016
@weinand weinand modified the milestones: January 2017, November 2016 Dec 5, 2016
@weinand weinand modified the milestones: February 2017, January 2017 Jan 23, 2017
@weinand
Copy link
Contributor

weinand commented Feb 16, 2017

This has made its way into the documentation. See note at the end of https://code.visualstudio.com/docs/editor/node-debugging#_launch-configuration-support-for-npm-and-other-tools

@weinand weinand closed this as completed Feb 16, 2017
@aeschli
Copy link
Contributor

aeschli commented Feb 24, 2017

Verified that this is in the documentation.

@aeschli aeschli added the verified Verification succeeded label Feb 24, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants