live-server
raw JSON → 1.2.2 verified Sat Apr 25 auth: no javascript maintenance
Simple development HTTP server with live reload capability. Version 1.2.2 (latest stable; last released in 2019, no longer actively maintained). It automatically reloads the browser upon file changes, supports CSS injection without full reload, and requires no browser plugins. Key differentiators: zero-config setup, CLI-driven, supports SPA fallback, CORS, HTTPS, and custom middleware. Alternative to browsersync or webpack-dev-server but more minimal and focused on static file serving with live reload.
Common errors
error Error: Cannot find module 'live-server' ↓
cause live-server not installed globally or locally
fix
Run
npm install -g live-server error port already in use ↓
cause Default port 8080 is occupied
fix
Use
--port=OTHER_PORT to specify a different port error Failed to load resource: net::ERR_CONNECTION_REFUSED ↓
cause live-server not running or wrong port
fix
Ensure live-server is running and check the port
Warnings
breaking live-server v1.2.0 dropped support for Node.js <6.0 ↓
fix Upgrade to Node.js 6+ or use live-server@1.1.1
deprecated --ignorePattern option is deprecated in favor of --ignore ↓
fix Use --ignore instead of --ignorePattern
gotcha live-server may not work with certain file watchers on Windows due to path separator issues ↓
fix Use forward slashes or double-backslashes in watch/ignore paths
Install
npm install live-server yarn add live-server pnpm add live-server Imports
- liveServer wrong
const { liveServer } = require('live-server')correctimport liveServer from 'live-server'
Quickstart
// Install globally via npm: npm install -g live-server
// In your project directory, run:
live-server --port=3000 --no-browser --quiet