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

NTVS projects do not run debug mode. #268

Closed
tmrwbailey opened this issue Jul 9, 2015 · 9 comments
Closed

NTVS projects do not run debug mode. #268

tmrwbailey opened this issue Jul 9, 2015 · 9 comments
Assignees
Milestone

Comments

@tmrwbailey
Copy link

I'm not sure what is peculiar to my configuration that causes this, and I'm having trouble gathering any additional information about the problem. I have posted to StackExchange and a PluralSight discussion, where you can find additional details.

When I try to start any NTVS project in Visual Studio, it seems to process for a split second, and then it just stops. This happens even for a brand new console app (hello world).

This is what I'm running:

MS Visual Studio Premium 2013 V. 12.0.31101.00 Update 4
.Net Framework Version 4.5.50938
Node.js version 0.12.6
Node.js Tools 1.0 for Visual Studio 2013 version 1.0.30324.01
Resharper 8.2.3

@billti
Copy link
Member

billti commented Jul 9, 2015

If you look at the properties for your project, are the "Node.exe path" and "Script (startup file)" both correct and pointing to the right files? If you try launching with F10 (which will try to run and break on the first line) is the behavior the same? If you open the Output window from the View menu, do any of the relevant outputs (e.g. Build, General, Debug) contain any useful info?

@tmrwbailey
Copy link
Author

@billti Thank you so much for responding.

Yes. The Node.exe path is correct. This happens for all NTVS projects, including example projects from Shawn Wildermuth's PluralSight course. Looking through several of these projects, I see "C:\Program Files\nodejs\node.exe" for all, which is where node is installed. None of these projects have script arguments. They are pretty simple example projects. Yes, F10 or "Step into new instance" does the same thing. There is nothing in Output: General. There is no Debug selection. In Build, if I just build the project or solution, it has only the one line summary:
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========

If I try to Run again though, Build is cleared; Output is all blank again.

@billti
Copy link
Member

billti commented Jul 10, 2015

"Script (startup file)" is more important the "Script arguments" - does this have a value? I assume this is also happening for new projects you create (e.g. the Express app template), and not just samples from elsewhere?

If so, this is strange indeed. If you run from the command line with debugging (e.g. "node --debug startupscriptname.js") does it work? (i.e. you enter the command-line debugger, and perhaps get a firewall prompt). You could also try launching VS as an Administrator and see if this makes a difference (in case it's a permission issue).

Finally, I see you are running 1.0 of Node Tools. There have been a few breaks and fixes in debugging since then (e.g. baef9a9). Could you try one of the latest Dev builds and see if that works for you? (See https://github.com/Microsoft/nodejstools/releases ).

@mousetraps
Copy link
Contributor

@billti - Script (startup file) was only recently added into the project properties page (see #153)

Instead, you can see the current value by selecting your project node, and pressing F4 to open the properties window.
image

To select a new startup file, you can right click on any javascript file, and select "Set as Node.js startup file"

@mousetraps
Copy link
Contributor

Also we did fix some debugging issues, so it's worth upgrading, but I'd be surprised if it fixes this issue, as non of them showed would have shown these symptoms...plus this issue is occurring with the default project, so the startup files should be fine... we also give an error if node found.

What happens if you execute a command like console.log('hello world'); in the Node.js Interactive Window (Ctrl+K, N)?

If you press Ctrl+F5 (to launch without the debugger), does it work?

Lastly, is the behavior any different if you use an older node version (e.g. 0.10.33)?
https://nodejs.org/dist/v0.10.33/

@tmrwbailey
Copy link
Author

@billti Sorry. I misread that. Startup file points to a .js which, for example, in a fresh new project such as I'm looking at right now has one line: console.log('Hello world');
And I have a breakpoint on that line which is also never hit.

Running node from the command line works in every way I have tried. I just now tried running the script exactly as you suggested. It works. This is the output:
C:\LocalPath>node --debug app.js
Debugger listening on port 5858
Hello world

The path, by the way, I copied directly from my Startup file property to be sure it is correct. Also, seeing the debugger port, I went ahead and tried manually entering that into the Debugger port property for the project. This doesn't change anything. So I removed that.

@mousetraps CTRL-F5 does pop up a console briefly. I added this to get the window to stay up until I closed it, and can see Hello World:
process.stdin.resume();

The interactive window also works:
Node.js interactive window. Type .help for a list of commands.

console.log('Hello world');
Hello world
undefined

All of this was done with version 1.0.30324.01. So today hopefully, I will try the same with the latest version and an older version and let you know if there are any differences. Thank you again so much.

@tmrwbailey
Copy link
Author

I have now tried these versions of Node Tools:
1.0.30324.01
1.1.30715.00
...and these versions of Node.js:
0.12.3
0.12.6
0.10.33

All symptoms have been identical, other than some new features showing up with the newer NTVS. Script (startup file) shows up in Properties and has the same file referenced, as already discussed. And along with the other two blank output windows, there is now also a blank Tests window.

I also did try running Visual Studio as Administrator. No luck. Everything is the same. Is there any way to get more log information from this process or something?

@billti billti added this to the September milestone Aug 21, 2015
@billti billti self-assigned this Aug 21, 2015
@mousetraps mousetraps modified the milestones: September, October Sep 24, 2015
@mousetraps mousetraps modified the milestones: October, November Oct 21, 2015
@mousetraps mousetraps modified the milestones: November, January Dec 11, 2015
@billti billti assigned mousetraps and unassigned billti Feb 9, 2016
@mousetraps
Copy link
Contributor

closing this issue as it's been a while and we've significantly improved our debugging experience since. Please let us know if you're still running into issues with the latest releases, and we'll investigate. https://github.com/Microsoft/nodejstools/releases

@BalassaMarton
Copy link

I have the same problem with the latest tools, please see #1265

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants