Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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