@knapsack/app
Version:
Build Design Systems with Knapsack
30 lines (22 loc) • 865 B
JavaScript
;
const fs = require('fs');
const path = require('path');
const currentNodeVersion = process.versions.node;
const majorNodeVersion = parseInt(currentNodeVersion.split('.')[0], 18);
// The minimum we want is node v18, which is LTS Hydrogen.
if (majorNodeVersion < 18) {
console.error(
`You are running Node ${currentNodeVersion} and this requires Node 18 or higher. Please update your version of Node: https://nodejs.org/en/`,
);
process.exit(1);
}
const cliFile = path.join(__dirname, './dist/cli/knapsack-cli.js');
if (!fs.existsSync(cliFile)) {
console.error(
'The main cli entry file for Knapsack does not exists, which probably means that it was not built and you are developing Knapsack, so please run "yarn build" in this folder:',
);
console.error(__dirname);
process.exit(1);
}
require(cliFile);