check-node-version is a utility designed to verify that the currently installed versions of Node.js and various package managers (npm, npx, yarn, and pnpm) meet specified semantic version ranges. It operates both as a command-line interface (CLI) tool for script automation and offers a programmatic API for integration into applications. The current stable version is 4.2.1, indicating a mature and well-established package. Its primary function is to prevent common environment-related issues by providing clear feedback and suggested installation steps (e.g., using `nvm`) when version requirements are not met. This makes it a crucial tool for maintaining consistent development and deployment environments across teams and CI/CD pipelines, differing from simple `node -v` by offering comprehensive checks and actionable advice for multiple tools.
npm install check-node-versionVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates the programmatic API to check Node.js, npm, and yarn versions. It logs success or lists unsatisfied versions with suggested fixes, exiting with an appropriate status code.
Ensure all tools (Node.js, npm, npx, yarn, pnpm) are installed with semver-compliant version strings. Update problematic tools if necessary.
Review and update the `engines` field in your `package.json` to reflect realistic and supported version ranges, or ensure Volta pins are current if using `--volta`.
Always verify the appropriate version management or installation method for your specific environment when `check-node-version` reports a version mismatch.
N/A - This indicates stability; focus on keeping your Node.js ecosystem tools updated.
Use a version manager (e.g., `nvm install <version>`, `nvm use <version>`) or update your global Node.js/package manager installation to meet the required range. The output typically provides a direct suggestion.
If installed locally, run with `npx check-node-version ...` or `npm run check-node-version ...` if defined in `package.json` scripts. If intended for global use, ensure it's installed globally: `npm install -g check-node-version`.
Inspect the `result.versions` object within your callback to identify which specific tool(s) failed and their respective `notSatisfiedVersion.message` for remediation. The example quickstart code demonstrates this.
Update the problematic tool (Y) to a version that reports a semver-compliant string. Some older or custom builds of package managers might exhibit this issue. Alternatively, consider checking only semver-compliant tools or adjusting the check logic if strict semver isn't crucial for that specific tool.
No dependency data recorded yet.