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 React Basics First Steps in React Add React to a Project

Zack Jackson
Zack Jackson
30,220 Points

Alternative live-server setup

Here's an alternative setup for a Node.js dev server that I used:

Verify that Node.js is installed. If you see anything when you run which npm in a terminal, it is. If not, follow the instructions at nodejs.org to install.

Install live-server: npm install -g live-server

Move your terminal to where your pages live: cd <path-to-content>

Start the server: live-server .

Open localhost:8080 in a browser.

If you want to set live-server up as an npm script, you can navigate to your project directory, run npm init, and then setup server under scripts. Make sure to install it as a dev dependency with --save-dev if you go this route (see below).

"scripts": { "serve": "live-server" }, "devDependencies": { "live-server": "^1.2.0" }

Thanks for this. Super useful!

You're a bonefide hero, Zack Jackson!

5 Answers

If anyone is using ATOM, check out the atom-live-server package for a super easy way to locally host your project.

Thanks! This is way better.