簡體   English   中英

如果我在Windows控制台中傳遞此代碼,則可以正常工作,但是當我在node.js中模擬Windows控制台時,代碼將不起作用,並返回不清楚的錯誤

[英]If I pass this code in Windows console it works, but when I emulate windows console in node.js code doesn't work, and returns unclear error

我有代碼:

cmd.get(
    'trimp3  ant.mp3 ant2.mp3 00:00 00:20',
    function(data){
        console.log('the node-cmd cloned dir contains these files :\n\n',data)
    }
);

如果在Windows控制台中傳遞此代碼,則效果很好! 但是,當我在node.js中模擬Windows控制台時,此代碼不起作用,並返回不清楚的錯誤:

[!!] ERROR:  "ffmpeg" �� ����� ����७��� ��� ���譥�
��������, �ᯮ��塞�� �ணࠬ��� ��� �������� 䠩���.

要模擬使用node-cmd。

您可能在錯誤的目錄中。

嘗試類似的東西:

cmd.get(
    'trimp3  /full/path/to/ant.mp3 ant2.mp3 00:00 00:20',
    function(data){
        console.log('node-cmd output:\n\n',data)
    }
);

要么

cmd.get(
    `
    cd /path/to/files/
    trimp3  ant.mp3 ant2.mp3 00:00 00:20
    `,
    function(data){
        console.log('node-cmd output:\n\n',data)
    }
);

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM