I'm currently trying out Node.JS and using Visual Studio Community with Node.js Tools as my primary IDE.
If I would create an Express application using this interface:
Then I would hit F5, my Express application would start and I'd see this nice debug window:
However, if I install Sails.js using npm -g install sails
, I no longer see this debug window in my test Sail.js app (if I create one in my Visual Studio), nor in Express app.
My application would start as expected, except that I can't see debug window anymore.
Debug window comes back only if I do following:
npm -g uninstall sails
How do I get debug window if I have Sails installed? I'd like to have it for both Express and Sails applications.
Attach the Node debugger and lift the Sails app (similar to running node --inspect app. js ). You can then use a tool like Chrome DevTools to interactively debug your apps (see the Node Inspector docs for more information).
The simplest way to debug a webpage is through the Debug: Open Link command found in the Command Palette (Ctrl+Shift+P). When you run this command, you'll be prompted for a URL to open, and the debugger will be attached. If your default browser is Edge, VS Code will use it to open the page.
Ran into a similar issue of running Sails application inside Visual Studio. Here's how I got my project properly running in Visual Studio, in case any stumbles on that question.
In another folder outside of your project initialize your sails app (if you haven't already), e.g. sails create appName. If you already know your API controllers/models, it's a good idea to create them right now. If not, you'll have to do it manually rather than using sails generate api
IMPORTANT: In Sails project folder, remove node_modules, in my case existing node modules were throwing VS npm off the track
Hope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With