Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Setting Up Google Chrome for Node.js Debugging2:50 with Andrew Chalkley
You'll learn to set up Google Chrome to inspect Node.js and the steps needed to enable Node.js to talk to Google Chrome's DevTools.
The application code can be found on GitHub.
To clone the code to your local machine use the following code.
git clone https://github.com/treehouse-projects/reverse-app-node.git
To install dependancies use
Debugging a node application with Google Chrome feature was first introduced
in Node.js 6.3+ but wasn't recommended for years until Node.js 6.4+.
You'll also need at least Google Chrome 55+.
The great thing about using Google Chrome as a debugging tool is that you can
debug both your front end and back end java script with the same interface.
You'll see how familiar it looks in a minute.
Open up Google Chrome and visit the experimental dev tool settings panel
by visiting chrome//flags,
hit Enter, and then scroll down to developer tools experiments.
Click enable and then Chrome will ask to restart.
Then open up the developer tools.
Head over to the settings.
This settings menu is hidden under this menu here with the three
dots stacked above each other.
Then go to experiments.
Then the next step is a little strange.
Hit the shift key six times.
You should now see some other options appear.
Including debugging node.js,
check the box next to the text, and then close down the panels.
Chrome is now set up to debug node applications.
Now let's set up the node side.
To put node into debug mode and generate a URL for Chrome to use to inspect your
application you need to pass in the -- inspect flak for
example the command would look like node--Inspect.
App.js if our application was in a file called appjs.
Since we're using MPM to start our application,
we'll need to modify the package.JSON.
And add the inspect flag.
Save the file, And start the application again with MPM start.
You should see a message when the server starts.
To start debugging open up the following URL in Chrome then copy the URL.
And paste it into Google Chrome.
And now you should see a familiar dev tools interface.
I'll cover the debugging features next.
You need to sign up for Treehouse in order to download course files.Sign up