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 Getting the Response Body

Nadine Schermerhorn
Nadine Schermerhorn
2,324 Points

Getting a 301 error

I have been getting a 301 error while doing the Node.js Basics. Happening on both my own editor and terminal as well as the workspace. I can't image you actually moved anything or the "chalkers"; however, I'm out of ideas. What else could be happening?

3 Answers

I had the same issue, the way I solved it was using https instead of http.

var https = require("https");

var request= https.get("https://teamtreehouse.com/"+username+".json",function(response)
Michael Barakat
Michael Barakat
3,420 Points

thank you for posting this. it really helped.

You need to change the http's in your program to https's should clear up the problem. It is because of a redirect that you are getting the 301 error.

Lanre TH
Lanre TH
1,037 Points

Thanks man it really helped