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 2017 Building a Command Line Application Making a GET Request with https

Joshua Whisenhunt
Joshua Whisenhunt
4,266 Points

Unexpected Token

I'm not certain what the error message "Unexpected Token" means.

app.js
const https = require('https');
const request = https.get(`https://teamtreehouse.com/chalkers.json`);

1 Answer

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,858 Points

Hey Joshua,

There are actually a couple of errors in the second line.

  • First you don't need the variable assignment request as the https was already assigned in the first line, so you'll need to remove const request =

  • Second, the error you are receiving is because, for some reason, you are using backticks to enclose a string. Those will need to be quotation marks (single or double).

Fix that up and you're good to go. :) :dizzy:

I assume he is using backticks because he's attempting to use a template literal