Skip to content

Latest commit

History

5 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

node-version-check

Catch Node.js version mismatches before they break your CI — across .nvmrc, engines, and runtime

License: MITZero dependenciesNode >=18

Install

npx github:NickCirv/node-version-check

Or with the short alias:

npx github:NickCirv/node-version-check nvc --help

Usage

# Check current project (reads .nvmrc, .node-version, .tool-versions, engines.node)
nvc
# Scan a monorepo — shows engines.node per package with compatibility status
nvc --scan .
nvc --scan ./packages
# Sync .nvmrc and .node-version to match package.json engines.node
nvc --fix
# Check latest LTS vs your running version (fetches from nodejs.org)
nvc --latest
# Compatibility matrix: packages × Node LTS versions
nvc --matrix
# CI mode — exits 1 on mismatch; supports GitHub Actions annotations
nvc ci
nvc ci --format github
FlagDescription
--scan [dir]Monorepo walk for engines.node mismatches
--fixUpdate .nvmrc / .node-version from engines.node
--latestLive LTS check from nodejs.org
--matrix [dir]Package × Node LTS compatibility table
--dir <path>Target directory (default: cwd)
--format githubGitHub Actions annotation output (ci command)
--help, -hShow help

What it does

Reads every version-pinning file in your project (.nvmrc, .node-version, .tool-versions, package.json engines.node) and compares each against the Node version currently running. In monorepos, --scan walks all sub-packages and flags inconsistent engines.node ranges. --fix writes the corrected version back to .nvmrc and .node-version after a confirmation prompt. The hand-rolled semver parser supports >=, ^, ~, x, compound ranges, and || — no semver package required.

CI integration

# .github/workflows/check.yml
- name: Check Node versionrun: npx github:NickCirv/node-version-check ci --format github

Exits 0 when all requirements are satisfied; exits 1 and emits ::error:: annotations on mismatch.

Environment

VariableEffect
NO_COLOR=1Disable colored output

Zero dependencies · Node >=18 · MIT · by NickCirv

About

Zero-dependency CLI to detect Node.js version mismatches across .nvmrc, engines, and runtime — with monorepo scan, --fix, and CI mode

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages