2
Der Versuch von NodeJS zu laufen gradlew:Lauf gradlew von NodeJS
const spawn = require('child_process').spawn;
const path = require('path');
function run() {
var path_dir = path.resolve('./../movies/VanillaApp/android');
var options = {
cwd: path_dir
};
const ls = spawn('gradlew', ['assembleRelease'], options);
ls.stdout.on('data', (data) => {
console.log(`stdout: ${data}`);
});
ls.stderr.on('data', (data) => {
console.log(`stderr: ${data}`);
});
ls.on('close', (code) => {
console.log(`child process exited with code ${code}`);
});
}
module.exports = {
run: run
};
Terminal equavalent:
> ./gradlew assembleRelease
bekommen:
events.js:154
throw er; // Unhandled 'error' event
^
Error: spawn gradlew ENOENT
at exports._errnoException (util.js:856:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
at onErrorNT (internal/child_process.js:344:16)
at _combinedTickCallback (node.js:377:13)
at process._tickCallback (node.js:401:11)
at Function.Module.runMain (module.js:449:11)
at startup (node.js:141:18)
at node.js:933:3
UPDATE:
Ich habe es geschafft, mit child_process.exec einzulaufen, aber nicht mit spawn.