diff --git a/index.js b/index.js index 5e4c6b9..8bbfc9e 100644 --- a/index.js +++ b/index.js @@ -11,6 +11,11 @@ module.exports = (grunt, options = {}) => { let cwd = process.cwd(); let config = options.config || pkgUp.sync(); + + if (config === null) { + grunt.fail.fatal('package.json not found. Make sure to create a package.json and install dependencies before you run Grunt.'); + } + if (typeof config === 'string') { const configPath = path.resolve(config); cwd = path.dirname(configPath);