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 Node.js Basics (2014) Building a Command Line Application Handling Errors in Node

Richard Nash
Richard Nash
24,862 Points

What's I doing wrong here?

I do not understand the error message / clue at all :-(

app.js
var http = require("http");
var userName = "Dick Nashly";

var request = http.get("http://teamtreehouse.com/" + userName + ".json", function(response) 
                       {
                         console.log(response.statusCode);
                         //Read Data
                         //Parse Data
                         //Print Data
                       }
);

request.on("error", function(error)
           {
              console.error(error.message);
            }
          );

2 Answers

Iain Diamond
Iain Diamond
29,379 Points

Hi Dick,

You seem to have signed up with the name Richard Nash (that is, not Dick Nashly), so your username is going to be:

  var userName = "richardnash";

I successfully tested your code with this username.

Hope this helps, iain

Richard Nash
Richard Nash
24,862 Points

lol, i missed the part where this actually had to access real user information!

k, thanks :-)

PS. This is what happens when you try to learn at 2am :-)

Thank you Iain Diamond.