Live video on the AT Protocol
at v0.9.9 20 lines 588 B view raw
1const pkg = require("../package.json"); 2const engines = pkg.engines; 3 4let version = engines.node; 5if (!version.startsWith(">=")) { 6 console.log( 7 `fix package.json! idk what engines.node=${version} means, i'm just a little script :(`, 8 ); 9 process.exit(1); 10} 11version = version.slice(2); 12const neededMajor = parseInt(version.split(".")[0]); 13const runningMajor = parseInt(process.version.slice(1).split(".")[0]); 14 15if (runningMajor < neededMajor) { 16 console.log( 17 `Required node version ${version} not satisfied with current version ${process.version}.`, 18 ); 19 process.exit(1); 20}