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:
parent
74e9ff75e3
commit
bba58a73d5
|
@ -13,8 +13,9 @@ function safeRequire(m) {
|
||||||
|
|
||||||
function createMiddlewareNotInstalled(memberName, moduleName) {
|
function createMiddlewareNotInstalled(memberName, moduleName) {
|
||||||
return function () {
|
return function () {
|
||||||
throw new Error('The middleware loopback.' + memberName + ' is not installed.\n' +
|
var msg = 'The middleware loopback.' + memberName + ' is not installed.\n' +
|
||||||
'Please run `npm install ' + moduleName + '` to fix the problem.');
|
'Run `npm install --save ' + moduleName + '` to fix the problem.';
|
||||||
|
throw new Error(msg);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue