2019-10-14 16:14:34 +02:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
module.exports = function checkBeforeInstall() {
|
2022-08-08 15:50:34 +02:00
|
|
|
const currentNodeVersion = process.versions.node;
|
|
|
|
const semver = currentNodeVersion.split('.');
|
|
|
|
const major = semver[0];
|
2019-10-14 16:14:34 +02:00
|
|
|
|
2021-06-23 07:55:40 +02:00
|
|
|
if (major < 12) {
|
2019-10-14 16:14:34 +02:00
|
|
|
console.error(`You are running Node ${currentNodeVersion}`);
|
2021-06-23 07:55:40 +02:00
|
|
|
console.error('Strapi requires Node 12 and higher.');
|
2019-10-14 16:14:34 +02:00
|
|
|
console.error('Please make sure to use the right version of Node.');
|
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
};
|