Skip to content

Commit cafd2a4

Browse files
philippsimonsindresorhus
authored andcommitted
Close #45 PR: Fix requireResolution with not found task.
1 parent 04ca4c8 commit cafd2a4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,11 @@ module.exports = function (grunt, opts) {
2525

2626
multimatch(names, pattern).forEach(function (pkgName) {
2727
if (opts.requireResolution === true) {
28-
grunt.loadTasks(resolvePkg(path.join(pkgName, 'tasks')));
28+
try {
29+
grunt.loadTasks(resolvePkg(path.join(pkgName, 'tasks')));
30+
} catch (err) {
31+
grunt.log.error('npm package "' + pkgName + '" not found. Is it installed?');
32+
}
2933
} else {
3034
grunt.loadNpmTasks(pkgName);
3135
}

0 commit comments

Comments
 (0)