# validate-node-version

> Compare current node version to node version required in package.json

Latest version **1.1.1** (published 2015-09-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install validate-node-version
pnpm add validate-node-version
yarn add validate-node-version
bun add validate-node-version
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2015-09-22 |
| First published | 2015-09-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jimmy King |
| Maintainers | jimmyking |
| Keywords | node, version, manager, validate, check, nvm |

## Links

- npm: https://www.npmjs.com/package/validate-node-version
- Repository: https://github.com/jking90/validate-node-version
- Issues: https://github.com/jking90/validate-node-version/issues
- npm.io page: https://npm.io/package/validate-node-version

## Dependencies (1)

- [semver](https://npm.io/package/semver.md) ^5.0.1

## Alternatives

- [@expo/fingerprint](https://npm.io/package/@expo/fingerprint.md) — 6.2M weekly downloads
- [@azure/monitor-opentelemetry-exporter](https://npm.io/package/@azure/monitor-opentelemetry-exporter.md) — 850.0K weekly downloads
- [@azure/monitor-opentelemetry](https://npm.io/package/@azure/monitor-opentelemetry.md) — 624.0K weekly downloads
- [@posthog/ai](https://npm.io/package/@posthog/ai.md) — 423.3K weekly downloads
- [fakefilter](https://npm.io/package/fakefilter.md) — 63.9K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2015-09-22
- 1.1.0 — 2015-09-17
- 1.0.1 — 2015-09-11

## README

# validate-node-version

A module that checks your current node version against a projects package.json

### Installation:

```
npm install --save validate-node-version
```

### Usage:

```js
var validatenv = require('validate-node-version')();

if (!validatenv.satisfies) {
  // handle bad node version
} else {
  // handle good node version
}
```

You can pass a version to the module that overrides the version in the projects `package.json`:

```js
require('validate-node-version')('4.0.x');
```

This module returns a an object with the structure below:

```js
{
  message: String, // a message about whether this failed or passed and why
  actual: String, // the current version of node being used
  expected: String, // the expected range for node version
  satisfies: Boolean, // does the actual version satisfy the expected version
}
```

#### Example Gulp integration

```js
var gulp = require('gulp'),
    validatenv = require('validate-node-version')();

gulp.task('validatenv', function () {
  if (!validatenv.satisfies) {
    console.error(validatenv.message);
    process.exit(1);
  }
});
```

---
_Source: https://npm.io/package/validate-node-version · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
