mirror of
https://github.com/strapi/strapi.git
synced 2025-11-12 08:08:05 +00:00
update version check
This commit is contained in:
parent
ffaff7c66a
commit
0c6f71c82f
@ -1,13 +1,15 @@
|
|||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
module.exports = function checkBeforeInstall() {
|
const { red, green, bold } = require('chalk');
|
||||||
var currentNodeVersion = process.versions.node;
|
|
||||||
var semver = currentNodeVersion.split('.');
|
|
||||||
var major = semver[0];
|
|
||||||
|
|
||||||
if (major < 12) {
|
module.exports = function checkBeforeInstall() {
|
||||||
console.error(`You are running Node ${currentNodeVersion}`);
|
const currentNodeVersion = process.versions.node;
|
||||||
console.error('Strapi requires Node 12 and higher.');
|
const semver = currentNodeVersion.split('.');
|
||||||
|
const major = semver[0];
|
||||||
|
|
||||||
|
if (major < 14 || major > 16) {
|
||||||
|
console.error(red(`You are running ${bold(`Node ${currentNodeVersion}`)}`));
|
||||||
|
console.error(`Strapi requires ${bold(green('Node 14 or 16'))}`);
|
||||||
console.error('Please make sure to use the right version of Node.');
|
console.error('Please make sure to use the right version of Node.');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user