使用解析时出现未处理的承诺拒绝错误

Unhandled promise rejection error when I using parsing

当我运行以下代码时:

const { dashdash } = require('dashdash');

const options = ....; //it's long so I replace them with ... to let me publish the post.

async function upload_photo() {
    const parser = dashdash.createParser({options: options});
    const opts = parser.parse(process.env);
    const path = opts.imagepath + "\" + opts.imagenumber + "." + opts.imageformat;
    console.log("***********"+path+"************" + "\" + opts.imagenumber + "." + opts.imageformat);
      const { latitude, longitude, searchQuery } = {
        latitude: 0.0,
        longitude: 0.0,
        // not required
        searchQuery: 'place',
      };

  const mediaLocation = locations[0];
  console.log(mediaLocation);

  const publishResult = await ig.publish.photo({

    file: await readFileAsync(path),
    // optional, default ''
    caption: 'Delicious food',

  });

  console.log(publishResult); 
}

(async () => {

    await login();
    await upload_photo();
    console.log('Succsess!');
    await logout();

})();

但是我得到以下错误:

我搜索了整个互联网,但一无所获。 我该如何解决?

改变

const { dashdash } = require('dashdash');

const dashdash = require('dashdash');