Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Nodejs version check v2 #278

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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