I have a node script whose job is to scaffold an app I've built. It creates files and folders then runs a series of node commands. All works perfectly. These are the commands that are run:
const postInstCmds = [
'npm init -y',
'npm install http-server --save-dev',
'npx add-npm-scripts server "http-server"',
'npm run server'
];
postInstCmds.forEach(cmd => execSync(cmd, {cwd: appDir}));
console.log('Done!');
However, in the terminal, it seems to hang on the penultimate (npx) command, even though it does run the final npm run server command (because the created app is available on localhost:8080). For presumably the same reason I never see my "Done!" log. This is what I see:
How can I get the terminal to complete the commands without hanging on the npx one?
