From bba58a73d5e778d8e3eca201e64ee1779c027a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 22 Jul 2014 15:40:36 +0200 Subject: [PATCH] express-middleware: improve error message Include the flag `--save` in the npm instructions, so that the missing module is both installed and saved in package dependencies. --- lib/express-middleware.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/express-middleware.js b/lib/express-middleware.js index cc67278c..bc316769 100644 --- a/lib/express-middleware.js +++ b/lib/express-middleware.js @@ -13,8 +13,9 @@ function safeRequire(m) { function createMiddlewareNotInstalled(memberName, moduleName) { return function () { - throw new Error('The middleware loopback.' + memberName + ' is not installed.\n' + - 'Please run `npm install ' + moduleName + '` to fix the problem.'); + var msg = 'The middleware loopback.' + memberName + ' is not installed.\n' + + 'Run `npm install --save ' + moduleName + '` to fix the problem.'; + throw new Error(msg); }; }