Reputation: 1463
Building my project using Angular-Cli works when I use it directly from my terminal window like this:
$ ng build
Now I'd like to run it from nodejs
using spawn. However,
const spawn = require('child_process').spawn;
const bld = spawn("ng build");
throws:
child process has an error with code Error: spawn ng build ENOENT
child process exited with code -2
Why is this happening? (I am running everything from inside the same folder.)
Upvotes: 3
Views: 640