I'm trying to run a component.io method from inside a script, though this shouldn't be specific to component.io.
Under normal circumstances, in a terminal, I'd write.
component install to install all the dependencies.
I've tried to different methods, but can't seem to get either to work (or show any output).
First I tried including component as a module
var componentIO = require('component');
componentIO.install();
Unfortunately, when I do this, nothing happens.
When I output console.log(componentIO), it outputs as part of the object install: [function], so I think I'm calling it correctly.
The other way I tried was via child_process
var cp = require('child_process');
var componentIO = cp.fork('component');
componentIO.send('install');
but again, I don't see any output in the terminal.
Am I taking the wrong tact to run commands from within node?