Skip to content

Commit

Permalink
fix: better error messaging for wizard without node_modules
Browse files Browse the repository at this point in the history
  • Loading branch information
Mila Votradovec committed Sep 24, 2018
1 parent da3d92c commit 45d892e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib/protect/get-vuln-source.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ function getVulnSource(vuln, cwd, live) {
try {
source = resolve.sync(from.slice(-1).pop(), viaPath);
} catch (e) {
if (e.code === 'NO_PACKAGE_FOUND') {
e = 'Error: `' +e.message + '`\nWe can\'t patch without ' +
'dependencies installed. Please run `npm ' +
'install` or `yarn install` first.';
}
if (live) {
throw e;
}
Expand Down

0 comments on commit 45d892e

Please sign in to comment.