From 96552a01f6cebae5c226b2a11f7ef32dbbb9840f Mon Sep 17 00:00:00 2001 From: Ruy Adorno Date: Tue, 16 Mar 2021 12:08:40 -0400 Subject: [PATCH] fixup! feat: add run-script workspaces --- lib/base-command.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/base-command.js b/lib/base-command.js index 9be2857bd697d..e266eb07660c4 100644 --- a/lib/base-command.js +++ b/lib/base-command.js @@ -1,5 +1,4 @@ // Base class for npm.commands[cmd] -const npmlog = require('npmlog') const usageUtil = require('./utils/usage.js') class BaseCommand { @@ -37,8 +36,10 @@ class BaseCommand { } execWorkspaces (args, filters, cb) { - npmlog.warn('This command does not support workspaces.') - cb() + throw Object.assign( + new Error('This command does not support workspaces.'), + { code: 'ENOWORKSPACES' } + ) } } module.exports = BaseCommand