Avast Premium Command line scanner

Hello, i have avast premium. I tried to use the command line scanner via node.js to scan my custom folder, but everytime when i tried i got error. Are there any restrictions on using the command line this way?

C:\Users\pc>node C:\Users\pc\Desktop\1.js
Error: Command failed: "C:\Program Files\Avast Software\Avast\ashCmd.exe" /a "C:\Users\pc\Desktop\scan\scan_dir"

and thats my code

const { exec } = require('child_process');

const scanDirectory = 'C:\\Users\\pc\\Desktop\\scan\\scan_dir'
const avastPath = 'C:\\Program Files\\Avast Software\\Avast\\ashCmd.exe'


exec(`"${avastPath}" /a "${scanDirectory}"`, (_, stdout) => {
    console.log(stdout);
});