Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print a useful error if package.json is missing #61

Merged
merged 7 commits into from Jul 31, 2019
5 changes: 5 additions & 0 deletions index.js
Expand Up @@ -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);
Expand Down