Skip to content

Commit fde5d73

Browse files
committed
Fix lookup logic (2)
1 parent e79602c commit fde5d73

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

bin/cnyks.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,14 @@ var module_path = cmdline[0];
2222
var module_name = path.basename(module_path);
2323

2424

25+
26+
2527
try {
26-
module_path = require.resolve(module_path, {paths : ['.']});
28+
try {
29+
module_path = require.resolve(module_path, {paths : ['.']});
30+
} catch(e) {
31+
module_path = require.resolve(path.resolve(module_path));
32+
}
2733
} catch(e) {
2834
throw Error(`Invalid module name, ${module_name}`);
2935
}

0 commit comments

Comments
 (0)