{"id":21622,"library":"nva-server","title":"nva-server","description":"nva-server is a frontend project development server that serves static content with features like asset serving, mock API configs, CORS support, and URL rewrites. It offers a command-line interface with options for port, host, content path, asset path, mock file, browser opening, and logging. Designed for development workflows, it integrates with the nva ecosystem. The package appears to have low maintenance based on sporadic releases, with the latest versions indicating ongoing but infrequent updates. It serves as an alternative to tools like http-server or serve with additional development-specific features.","status":"maintenance","version":"0.7.2","language":"javascript","source_language":"en","source_url":"https://github.com/ali322/nva/tree/master/packages/nva-server","tags":["javascript"],"install":[{"cmd":"npm install nva-server","lang":"bash","label":"npm"},{"cmd":"yarn add nva-server","lang":"bash","label":"yarn"},{"cmd":"pnpm add nva-server","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package is ESM-only since v1.0.0. Use import syntax.","wrong":"const nvaServer = require('nva-server')","symbol":"default","correct":"import nvaServer from 'nva-server'"},{"note":"Named export for programmatic usage. Check documentation for exact API.","wrong":"const run = require('nva-server').run","symbol":"run","correct":"import { run } from 'nva-server'"},{"note":"If Server class is exported, use named import. See changelog for v0.x vs v1.x.","wrong":"const Server = require('nva-server').Server","symbol":"Server","correct":"import { Server } from 'nva-server'"}],"quickstart":{"code":"npm install nva-server --save\nexport PORT=5000\nnva-server -p $PORT -c ./public --cors --log","lang":"bash","description":"Install the package, set environment variable for port, then run the CLI to serve ./public with CORS and logging enabled."},"warnings":[{"fix":"Use import syntax or upgrade to supported versions.","message":"v1.0.59 introduced ESM-only support, breaking CJS require() usage.","severity":"breaking","affected_versions":">=1.0.59"},{"fix":"Refer to latest docs for configuration file approach.","message":"The --config option may be deprecated in favor of nva-server.config.js file.","severity":"deprecated","affected_versions":">=0.3.43"},{"fix":"Use full option names like --port, --content to ensure compatibility across versions.","message":"CLI options changed between versions: -p vs --port etc. Use long options for compatibility.","severity":"gotcha","affected_versions":">=0.1.39"},{"fix":"Provide absolute path or ensure relative path is correct from CWD.","message":"Mock API feature requires proper file path; relative paths are resolved from current working directory.","severity":"gotcha","affected_versions":">=0.1.38"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'npm install nva-server --save' (note hyphen, not underscore).","cause":"Package not installed or name typo.","error":"Error: Cannot find module 'nva-server'"},{"fix":"Add 'type':'module' to package.json, or use require if version <1.0.59.","cause":"Using ESM import syntax without 'type':'module' in package.json or .mjs extension.","error":"SyntaxError: Cannot use import statement outside a module"},{"fix":"Install globally: npm install -g nva-server, or use npx nva-server.","cause":"Not installed globally or not in PATH.","error":"nva-server: command not found"},{"fix":"Use --port instead of -p.","cause":"CLI parser expecting long options in newer version; -p may be removed.","error":"Missing option: -p"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}