visual studio 2015 node js app doesn't start debugging - node.js

I am creating a purely server side nodejs app in visual studio and the majority of times I go to debug it, it does not start running my javascript.
I see "Debugger listening on port xxxx" and nothing else.
Opening and closing the project solves it and have had some luck manually ending the VSHub.exe process (maybe coincidental) but I don't want to have to do this everytime I debug.
Anyone seeing this or got any ideas?

This is a known issue with the node js tools extension.
The fix was included in dev build v1.1.Dev-9.17.2015 which is available from here until it is included in an official release.

I had the same problem with the Community version, deleting the project, reinstalling VS2015, then recreating the project seems to have fixed it.
Mysterious.

Related

Blazor build hangs in Visual Studio

I'm putting this out here to save someone else some of my pain. Today I built my Blazor solution and it simply hung. Searching on this will give you alot of results that have nothing to do with Blazor.
There was no indication as to what happened and I didn't find out until I tried updating VS that a Node.exe process running on my machine.
Node.exe is the NodeJS process that is used by VS as a debugger proxy for the client-side WASM project. Kill the Node.exe process and you should be able to build again.

Best way to debug Node.js application in IntelliJ or WebStorm

I see a lot of posts how to debug posts and talks on how debug node application and they mostly points to vs code and other command line tools.
As a fan of IntelliJ and WebStorm IDE, is anything I am missing which can save my day while debugging my Node.js application?
Please see https://blog.jetbrains.com/webstorm/2014/05/guide-to-node-js-development-with-webstorm/ - this post is not new, but still relevant
Jetbrains has a write up of how to debug Node.js applications that is a good starting point:
https://www.jetbrains.com/help/idea/running-and-debugging-node-js.html
The biggest issue that I've run into is that none of the provided solutions automatically restart your application when changes are made. I've worked around this by using their remote debug functionality and attaching to a server running with nodemon. However, I still have to manually restart the remote debug job in IntelliJ as it does not automatically reconnect when the remote debug server restarts.
There is an open YouTrack request to add this functionality, but Jetbrain's recommendation is to instead use their Live Edit functionality.
Live Edit is bundled by default with Webstorm, but has to be installed on IntelliJ Ultimate. I have not tried using Live Edit with a Node.js application, but their documentation says that it should work.

Debugging Meteor app with NTVS (Node Tools for Visual Studio)

I'm investigating using NTVS (https://nodejstools.codeplex.com/) with Visual Studio 2013 to debug my Meteor/Node application. I can't figure out how to get debugging to work.
The problem is that when Meteor starts it copies all of my sources to the .local directory and runs them in a new instance of Node.exe. This confuses NTVS because it can't follow on into the child process. And I can't set breakpoints because Visual Studio doesn't know how to deal with the fact that the files I am editing being different than the ones that are running in the .local directory.
What I'd like is some way to run my Meteor based code under Node.exe straight from my sources, without the pre-bundling steps. Is this possible?
I'm fine with not having development niceties like hot-code pushing and package updates on-the-fly. I can manage that in other ways.
'meteor bundle' doesn't do the trick because (a) it takes too long and (b) it still makes the copy that throws off breakpoints.
Hopefully there is a way to use Meteor as an awesome library separate from Meteor as a runtime environment so I can debug it with NTVS.
Thanks,
/Michael Ost
if the functionality of the meteor tools for Visual Studio are not sufficient, why not contribute to the project.
It's a bit old (last commit 18 months ago) and hence probably outdated, but it will give you a head start as to how to make things work.
You can run your app in debug mode using meteor debug and then attach debugger to port number 5858, It should work for all type of node.js debuggers e.g. Visual Studio, Visual code, Webstorm etc because they all have "attach" debugger option next to "debug" option.

Trouble debugging nodeJS with nodeclipse (Failed to connect to Standalone V8 VM)

Hoping someone can help. I've been through every forum, the online help, every youtube, and every example to find an answer. This either means it's incredibly nuanced or incredibly simple and I'm just missing something that seems to work for everyone.
Nodeclipse/chromedevtools failed to connect to Standalone V8 VM
( Check Help (F1) and Support http://www.nodeclipse.org/#support )
. Info:
connect timed out
I get the above error when I use nodeclipse to debug a node app using the right-click menu on the project. DEBUG AS -> NODE APPLICATION.
When I RUN AS -> NODE APPLICATION, it launches just fine. But when I run with debug-as, I get that error and the debug info looks like.. (or not.. I can't post images... but it terminates the V8 VM entry)
I've installed JDK 8, the most recent NodeJS, the express packages, enide studio from nodeclipse.org, and followed the instructions to build a starter app (new - express project), then attempted to debug that app with debug-as->node application.
I can successfully debug a node instance (my actual project) that I start from the command line, and it lets me step through the virtual project files, etc.. but I was looking for the "all in one" nature where I am debugging the same files I'm editing and can launch/test it all from within eclipse.
Win 7, 64bit
JDK 1.8.0_11 64bit
node 0.10.29 64bit
nodeclipse/enide studio 2014-011-20140228-win64
I've tried it with JDK1.7 as well (64 bit).
Any and all help would be appreciated.
Regards,
Zig
While the issue happened before it is hard to reproduce on other machines.
More stats is needed.
http://www.nodeclipse.org/#support gives links to Online Help (the same as built-in by F1)
in particular
https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.help/contents/run.md
and https://github.com/Nodeclipse/nodeclipse-1/blob/master/org.nodeclipse.help/contents/debug.md
Have you tried to
to run node --debug-brk app.js first, and then again in Eclipse/Enide Studio ? #107
I've had some luck getting around this error by:
Right clicking in the server and selecting run as -> node application
Navigating in Firefox to the address where my server is listening
Stopping the server in the console
Right clicking in the server and selecting debug as -> node application
I also created a new perspective called "visualstudio" and do no switch perspectives between development and debug (though I doubt perspectives have much to do with the issue)
Using this approach, I get an interesting anamoly where the debugger breaks on line 1 when the server starts, and I then have to click resume. However, after resuming, execution only stops when a request hits a breakpoint.
You have to run the command to debug the node.js file:
node --debug-brk yourfilename.js (this is not working now)
node --inspect-brk yourfilename.js

Visual Studio deployment error

"The application could not be launched for debugging. Please make sure the device is unlocked."
I am getting this error when I try to launch the app on my device for debugging.
I have tried the following:
Relaunch Visual Studio,
Reinstall Visual Studio,
Restart my computer,
I have selected both debug and release in the configuration window.
The problem is that its not getting launched even in the emulator. The emulator opens and never loads the app but gives the same error message. And I have tried to just open a new application on VS and tried to run the default application. That also gives the same problem.
Everything was working fine after I opened a few more projects for reference, It suddenly started giving this error message.
Make sure a Windows project is not set as startup(assuming you have both windoes project and phone project in the same solution). For example If your target platfrom is a Windows phone project WP7, then you cannot have a windows project as startup. This is a known reason for the error you mentioned.
Also what is the operating system you are working with? I know the error you mentioned reprorted on some OS's including Windows server 2003 and 2008. Try running your project in winsdows 7.
I suddenly got exactly the same issue today. I was coding like always and then I got this problem.
// P.S.
// Today I updated Windows from 8 to 8.1
// Then I installed VS 2013 preview
// But continued working in VS 2012 (I need R#)
// After ~ 5 hours of work I got this issue
I tried everything, deleted emulators from Hyper-V, deleted all virtual commutators, restarted VS 2012, restarted laptop, deleted Bin and obj folders from project, rebuilded project.
But nothing helped.
Then I tried to open solution in VS 2013 preview, and it works!!
I hope I help you with this answer.
If somebody know how to fix it in VS 2012, please tell us
I have a similar problem but I’m able to debug my app once I click OK on the error prompt following the “Launching TaskHost.exe failed.” message in the status bar. I haven’t been able to solve it but I’ve found a workaround that might also work for you.
Start the “Simulation Dashboard” under “Tools” and instead of starting the debugger the usual way build your project if needed and then try to start the debugger by clicking “Locked” under “Lock Screen” on the dashboard.
This answer worked for me.
Under the following:
Solution(Right-click) > Properties > Configuration Properties > Configuration
Ensure that your main project is set to 'Deploy.'

Resources