diff --git a/start.js b/start.js index d95d89efe..d8808a90e 100644 --- a/start.js +++ b/start.js @@ -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}`);