Skip to content

Commit

Permalink
🥅 Check version of Node, exit if not supported (#398)
Browse files Browse the repository at this point in the history
* 🥅 Check version of Node

Even though NPM/yarn checks on install, due to the number of warnings/erros in a
given JS project, it's never noticed. We're going to hard error and exit on any
unsupported versions of Node now to prevent support requests based on this.

* ♻️ Peer review updates
  • Loading branch information
Robdel12 authored Jun 28, 2021
1 parent 7119148 commit a8e9523
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/cli/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
/* istanbul ignore if: hard to test without actually using an unsupported version */
if (parseInt(process.version.split('.')[0].substring(1), 10) < 12) {
console.error(`Node ${process.version} is not supported. Percy only supports the current LTS of Node. Please upgrade to Node v12+`);
process.exit(1);
}

const { promises: fs } = require('fs');
const path = require('path');

Expand Down

0 comments on commit a8e9523

Please sign in to comment.