linuxdan linuxdan - 1 year ago 106
Node.js Question

How to get output from node exec when running `npm install`?

I'm running the following:

const exec = require('child_process').exec;
let installProcess = exec('npm install');

But I get no output in my terminal, what else can I try?

Answer Source

The following ended up working for me:

const execSync = require('child_process');
execSync('npm install', {stdio:[0,1,2]});
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download