Skip to content

Commit

Permalink
feat(rspack-cli): emit warning if the using nodejs version is not rec…
Browse files Browse the repository at this point in the history
…ommended (#2575)

* feat: validate nodejs version

* chore: v12 minimum

* chore: review changes
  • Loading branch information
dhruvkelawala authored Apr 1, 2023
1 parent e40bda7 commit a5170ad
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/rspack-cli/src/rspack-cli.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import semver from "semver";
import { hideBin } from "yargs/helpers";
import yargs from "yargs";
import util from "util";
Expand Down Expand Up @@ -76,6 +77,12 @@ export class RspackCLI {
};
}
async run(argv: string[]) {
if (semver.lt(semver.clean(process.version), "14.0.0")) {
this.getLogger().warn(
`Minimum recommended Node.js version is 14.0.0, current version is ${process.version}`
);
}

this.program.usage("[options]");
this.program.scriptName("rspack");
this.program.middleware(normalizeEnv);
Expand Down

0 comments on commit a5170ad

Please sign in to comment.