Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Express Basics (2015) The Request and Response Objects in Express Requests and the request object

Dan Lauby
Dan Lauby
7,897 Points

When I insert "brk" in the nodemon --debug-brk app.js command, my server won't start.

I can start my server with:

$ nodemon --debug app.js

Result:

$ nodemon --debug app.js
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node --debug app.js`
Debugger listening on port 5858
Express server is running...

And node-inspector (in a second bash window) as well:

$ node-inspector

Result:

$ node-inspector
Node Inspector v0.12.8
Visit http://127.0.0.1:8080/?port=5858 to start debugging.

Though when I run:

$ nodemon --debug-brk app.js

My server will not start:

$ nodemon --debug-brk app.js
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node --debug-brk app.js`
Debugger listening on port 5858

My app.js:

'use strict';

var express = require('express'),
    posts = require('./mock/posts.json');

var app = express();

app.get('/', function(req, res) {
  res.send("<h1>My Express App!</h1>");
});

app.get('/blog/:title', function(req, res) {
  debugger;
  var title = req.params.title;
  var post = posts[title];
  res.send(post);
});

app.listen(3000, function() {
  console.log("Express server is running...");
});

After several days of researching for answers I have not found anything that solves this issue. Am I missing something obvious?

I am running:

Windows 10

MINGW64 Bash

Node v4.6.1

Express v4.14.0

node-inspector v0.12.8

nodemon v1.11.0

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

While I haven't personally experienced this, I have seen this thread where multiple people are describing this symptom. You might take a look here. Hope you get it working! :sparkles:

1 Answer

Dan Lauby
Dan Lauby
7,897 Points

Ahhh, needed to restart my terminal. Thank you kindly, Jennifer Nordell!