diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 899d92ca937cc..8c8cb3efa3088 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -176,7 +176,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { // public method async buildIdealTree (options = {}) { if (this.idealTree) { - return Promise.resolve(this.idealTree) + return this.idealTree } // allow the user to set reify options on the ctor as well. @@ -194,8 +194,7 @@ module.exports = cls => class IdealTreeBuilder extends cls { process.emit('time', 'idealTree') if (!options.add && !options.rm && !options.update && this[_global]) { - const er = new Error('global requires add, rm, or update option') - return Promise.reject(er) + throw new Error('global requires add, rm, or update option') } // first get the virtual tree, if possible. If there's a lockfile, then