adresinden cygwin komutunu çalıştırın Node'un child_process
modülünü kullanarak, cygwin kabuğundan komutları yürütmek istiyorum. Bu benim çalıştığım şey: Ben ne olursa olsun shell
seçenek olmaktan setin, bash.exe bu argümanlar ne yapacağını bilmez, Node's child_process.js will add the /s
and /c
switches görebilirsinizNodeJS
var exec = require('child_process').execSync;
exec('mkdir -p a/b/c', {shell : 'c:/cygwin64/bin/bash.exe -c'});
TypeError: invalid data at WriteStream.Socket.write (net.js:641:11) at execSync (child_process.js:503:20) at repl:1:1 at REPLServer.defaultEval (repl.js:262:27) at bound (domain.js:287:14) at REPLServer.runBound [as eval] (domain.js:300:12) at REPLServer. (repl.js:431:12) at emitOne (events.js:82:20) at REPLServer.emit (events.js:169:7) at REPLServer.Interface._onLine (readline.js:212:10)
.
bu sorun için geçici bir iş bulmuş ama gerçekten ideal değil:exec('c:/cygwin64/bin/bash.exe -c "mkdir -p a/b/c"');
besbelli yalnızca Windows değil unix sistemlerde çalışacak yukarıda yapmak.
NodeJS'den cygwin kabuğundaki komutları nasıl uygularım?