Reputation: 4618
I have created a node project using the express-generator and have not added any additional code to it. If i run it from the npm command prompt with npm start, it is working on localhost:3000.
If i use the template from existing nodejs code in Visual Studio, hitting the debug or run button never works. It pops the node.exe console and closes it after one sec. "Debugger listening on port 5858".
Creating an express app from Visual Studio works as expected.
What do i have to configure to get it working the same way as a default project created with VS?
Update:
Seems that even if I take the files from the working project and use them to create another "From Existing Node.js code" the debug/run command fails. So i guess it has something to do with the project file, but i checked them and they seem to be the same. What am i missing?
Upvotes: 1
Views: 455
Reputation: 4618
After much digging i ran WinMerge on both projects and noticed that inside the project file StartupFile was set to app.js instead of bin/www.
To change the StartupFile, right-click on the JS app and select "Properties". Under "General", you will see "Script (startup file)", which is where you make the change.
Home this helps someone else trying to use Visual Studio as an IDE for node.js.
Upvotes: 1