Welcome to the Treehouse Community
Looking to learn something new?
Jill Lopez405 Points
I can't get my local server to run
I followed the instructions from this site (as recommended): https://developer.mozilla.org/en-US/docs/Learn/Common_questions/set_up_a_local_testing_server#Running_a_simple_local_HTTP_server.
I cd into the project folder that I am in "o:\Coding\Projects\scoreboard\scoreboard>" and use the prompt "python -m http.server". When I open localhost:8080 on the browser, it says "This site cannot be reached."
Gabbie Metheny33,778 Points
Another student posted here about using http-live-server, installed through npm. It has very few downloads, though, and I'd recommend something that's been vetted. I'm using http-server because I'd already installed it in the past for other treehouse courses. You install it globally through npm (
npm install -g http-server), and then in the root of your project, all you do is run
http-server in your console. You'll get a console message telling you what port your site is running on, for me it's
http://127.0.0.1:8080. The only difference for how it's working for me vs. how Guil's server works in the videos is that I have to hard reload every time I make changes (on Chrome in Windows, with dev tools open, right click on the refresh icon, select 'Hard Reload', or just press
Ctrl+Shift+R). Hope that helps!
Zack Jackson30,220 Points
Just posted a response in an earlier video for how I'm going about this with Node.js rather than with python. Link at the bottom.
You can run it globally or set up your project folder with npm init and then set live-server up as a devDependency and a npm script.
live-server has been around for 2 years and has several hundred thousand downloads per month. It also automatically watches and auto reloads the page which is awesome.
Hope this helps.
Dave StSomeWhere19,822 Points
When you did the python -V what did you get?
You might need to run python3 -m http.server - often python is 2.7 while python3 is 3.x
You should get something like - on my desktop it uses port 8000 as the default:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/)
Nickolas Fuentes14,016 Points
If people also have another port running something.
You can try this
python3 -m http.server 7800
and it will give you another port to run it on. Also download the React Developer Tools!@