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.
This commit is contained in:
Miroslav Bajtoš 2014-07-22 15:40:36 +02:00
parent 74e9ff75e3
commit bba58a73d5
1 changed files with 3 additions and 2 deletions

View File

@ -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);
};
}