Skip to content

Instantly share code, notes, and snippets.

@ganeshkumartk
Created January 28, 2020 18:08
Show Gist options
  • Save ganeshkumartk/ad6526ad7ef78ae7dd3afa7ef969cd20 to your computer and use it in GitHub Desktop.
Save ganeshkumartk/ad6526ad7ef78ae7dd3afa7ef969cd20 to your computer and use it in GitHub Desktop.

Installing Node.js live-server

The NodeJS live-server package runs a temporary server displaying any HTML/CSS/JS resources in the current folder. It automatically reloads the page in your browser when any of these files change.

OS X

  • 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.

Windows

  • Verify that Node.js is installed. If you see anything when you run which npm in a command line, 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.

Linux

  • 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment