Skip to content

Commit

Permalink
Update start.js fix to allow old and new versiond of nodejs to be used
Browse files Browse the repository at this point in the history
  • Loading branch information
decagondev authored Dec 20, 2023
1 parent 03eb6bd commit 02a5a39
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions start.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
const { spawn } = require("child_process");
const { Buffer } = require("buffer");

const ls = spawn(/^win/.test(process.platform) ? 'npx.cmd' : 'npx', ['craco', '--max_old_space_size=4096', '--openssl-legacy-provider', 'start']);

const nodeVersion = process.version;
const majorVersion = parseInt(nodeVersion.slice(1).split('.')[0], 10);
let cmdArray = [];

majorVersion < 17 ? cmdArray = ['craco', '--max_old_space_size=4096', 'start'] : cmdArray = ['craco', '--max_old_space_size=4096', '--openssl-legacy-provider', 'start']

const ls = spawn(/^win/.test(process.platform) ? 'npx.cmd' : 'npx', cmdArray);

ls.stdout.on("data", data => {
console.log(`${data}`);
Expand Down

0 comments on commit 02a5a39

Please sign in to comment.