Search code examples
node.jscordovachild-process

Node EXEC ignoring parameters


Running the following command cordova build android --release -- -- --packageType=bundle it works fine on the cmd but when running it with node using the exec function it ignores the parameters? Any suggestions? Thank you!

const exec = require('child_process').exec;
exec('cordova build android --release -- -- --packageType=bundle', async function (error, stdout, stderr) {
            if(error){
                return log(error.message)
            }

            callBack && callBack(stdout);
            return resolve();
        })

Solution

  • You're adding too many -- It's

    cordova build android --release -- --packageType=bundle