fix: do not pack rejections from resolve in array (#88)
diff --git a/index.js b/index.js
index 959c4e1..35c78bd 100644
--- a/index.js
+++ b/index.js
@@ -20,10 +20,14 @@
const path = require('path');
const fs = require('fs-extra');
const { CordovaError, events, superspawn } = require('cordova-common');
-const resolve = pify(require('resolve'), { multiArgs: true });
const npa = require('npm-package-arg');
const semver = require('semver');
+// pify's multiArgs unfortunately causes resolve to wrap errors in an Array.
+// Thus we wrap the function again to unpack these wrapped errors.
+const rslv = pify(require('resolve'), { multiArgs: true });
+const resolve = (...args) => rslv(...args).catch(([err]) => { throw err; });
+
/**
* Installs a module from npm, a git url or the local file system.
*