Registry / http-networking / sirv-cli

sirv-cli

JSON →
library3.0.1jsnpmunverified

sirv-cli is a lightweight, zero-config CLI tool for serving static files from any directory. It supports HTTP/2, CORS, ETags, gzip/brotli precompressed files, single-page app fallback, and immutable cache headers. Version 3.0.1 requires Node 18+ and ships native ESM via an exports map. It differs from alternatives like http-server or serve by being minimal, fast, and designed for development previews. Regular releases (2-3 per year) with breaking changes infrequent.

npm install sirv-cli
INSTALL
IMPORT
SIG · SIRV-CLI
S
sirv-cli
http-networkingjavascriptv3.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

sirv-cli (CLI)
npx sirv-cli [dir]
Running the package directly as a script without npx and missing options
This is a CLI tool, not a library; install globally or use npx.

Install sirv-cli globally and start a dev server on port 8080.

npm install -g sirv-cli sirv --port 8080 --dev # Navigate to http://localhost:8080
sirv --version
Debug
Known issues
breakingNode 18+ required since v3.0.0
fix
Upgrade Node.js to version 18 or later.
affects: >=3.0.0
breakingDefault port changed from 5000 to 8080 in v2.0.0 due to macOS Monterey reserving port 5000 for AirPlay
fix
Update scripts or explicitly use --port 5000 if needed.
affects: >=2.0.0
deprecatedHTTP/2 support requires Node 8.4+ but v3 requires Node 18+; --http2 flag still accepted but may be removed in future
fix
Use HTTPS with a reverse proxy for HTTP/2 in production.
affects: >=3.0.0
gotchaHOST and PORT environment variables override --host and --port flags
fix
Unset environment variables or use flags exclusively.
affects: >=1.0.0
gotchaBy default server is only accessible on localhost (not network); use --host to expose
fix
Add --host flag to allow network access.
affects: >=1.0.0
Errors
Common errors & fixes
Error: listen EADDRINUSE :::8080
Port 8080 already in use by another process
fix
Use a different port with --port or kill the process using the current port.
Error: Cannot find module 'sirv-cli'
sirv-cli not installed
fix
Run 'npm install -g sirv-cli' or 'npx sirv-cli'.
sirv: command not found
sirv-cli not installed globally or not in PATH
fix
Install globally with 'npm install -g sirv-cli' or use npx.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
11 hits · last 30 days
node
8
OpenAI (training)
1
Resources
sirv-cli — npm install sirv-cli · libregistry