I'm spawning npm install -g create-react-app
from a js
script. I want to know if it's possible to get the progress of the installation using spawn
.
const npmExecutable = /^win/.test(process.platform) ? "npm.cmd" : "npm";
const npm = spawn(npmExecutable, ["install", "-g", "create-react-app"]);
I have read this question about using:
npm.on("message", data => {
console.log(`A message: ${data}`);
});
but it does not show anything.
There is a related question, about knowing the progress of a python
script, but it does not have any answers.
Does someone of you have tried something like that or know any clue about this?