This repository has been archived by the owner on Feb 16, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GB] check installed deps & log user friendly error, fix #2455
- Loading branch information
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const deps = require('./package.json').dependencies; | ||
|
||
const missing = []; | ||
|
||
Object.keys(deps).forEach(dep => { | ||
try { | ||
require(dep); | ||
} catch(e) { | ||
if(e.code === 'MODULE_NOT_FOUND') { | ||
missing.push(dep); | ||
} | ||
} | ||
}); | ||
|
||
if(missing.length) { | ||
console.error( | ||
'\nThe following Gekko Broker dependencies are not installed: [', | ||
missing.join(', '), | ||
'].\n\nYou need to install them first, read here how:', | ||
'https://gekko.wizb.it/docs/installation/installing_gekko.html#Installing-Gekko-39-s-dependencies\n' | ||
); | ||
process.exit(1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters