response.write() not working in exec

I am following a node.js tutorial and am making a simple server that will display contents of a directory.

function start(response) {
  console.log("Request handler 'start' was called.");

  // if I put response.write("blah") here it works
  console.log(response);
  exec("ls -lah", function (error, stdout, stderr) {
    console.log(response);
    response.writeHead(200, {"Content-Type": "text/plain"});
    response.write(stdout);
    response.write("asdfasdf");

    console.log("asdf");
    console.log(stdout);
    response.end();
  });
}

This prints nothing on the browser, but shows up on the console.

I tried putting response.write() outside of the exec callback function, and it shows up perfectly on the browser.

Firefox is reporting that the request is not being set at all, not even the content-type header is being set. If I move that outside the exec callback function, it does get set.