Skip to content

Commit

Permalink
Fix Nodejs version check v2 (#278)
Browse files Browse the repository at this point in the history
  • Loading branch information
lcampos authored Sep 30, 2024
1 parent a176125 commit 41ccc7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ import lint from "./cmds/lint.js";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { printCriticalFailureToConsoleAndExit } from "./common/output.js";
import { gte } from "semver";
import { lt } from "semver";

dotenv.config();

const MIN_NODE_VERSION = "20.0.0";

if (gte(MIN_NODE_VERSION, process.versions.node)) {
if (lt(process.versions.node, MIN_NODE_VERSION)) {
await printCriticalFailureToConsoleAndExit(
`The Rate My OpenAPI CLI requires at least node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of node.js.
`The Rate My OpenAPI CLI requires at least Node.js v${MIN_NODE_VERSION}. You are using v${process.versions.node}. Please update your version of Node.js.
Consider using a Node.js version manager such as https://github.com/nvm-sh/nvm.`,
);
Expand Down

0 comments on commit 41ccc7a

Please sign in to comment.