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 Organizing Your Code with require

Juliette Tworsey
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,425 Points

module.exports.get = get;

Hi,

The console in Workspaces is returning the wrong information when I attempt to call get in app.js via the console.

I have no idea as to what could be wrong.

Thanks in advance to anyone who can spot what is missing from my code:-)

https://w.trhou.se/9p6darlvyd

2 Answers

Kevin Korte
Kevin Korte
28,148 Points

When I run it, the console says SyntaxError: Unexpected token { on line 30 of profile.js.

You forgot something. Can you spot it?

Kevin Korte
Kevin Korte
28,148 Points

Yep, that was it, and yes on to the next error. I'm going to only help lead you to debug this yourself, using the same logic you will develop to solve these issues yourself.

So, onto the next error. What does it say? I see printError({message" "There was an error getting the profile for " + user SyntaxError: Unexpected string If you look at the console, it's actually pointing to where the error is at. Unexpected string also tells us we probably messed up with our quote marks. Do you see the syntax error? It's in the console and where I copied the text over.

Kevin Korte
Kevin Korte
28,148 Points

You got it! We all have these problems, lol. Have fun with it. I just went through these lessons myself a few days ago.