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 React Basics (2018) 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.