grunt-init-gruntfile icon indicating copy to clipboard operation
grunt-init-gruntfile copied to clipboard

Generated package.json is missing attributes used in the banner

Open kontur opened this issue 10 years ago • 4 comments

Hey,

it's quite obvious that developers using the package.json will add the necessary attributes like name and homepage themselves, but for first time users it might be confusing that this grunt template's grunt tasks fails due to missing package attributes (used in the banner config). The outputted warning with a fresh install is:

Running "concat:dist" (concat) task
Warning: An error occurred while processing a template (Cannot read property 'name' of undefined). Use --force to continue.

Should the generated package.json include placeholders or empty values for all attributes used in the banner, and maybe when using the package.json generator print a notice to edit those.

I can provide a PR for this, if needed.

kontur avatar Aug 12 '14 08:08 kontur

Or wrap those elements of the banner into conditionals as well in the banner config.

kontur avatar Aug 12 '14 08:08 kontur

I couldn't get rid of the error even if i added the attributes to the package file.

Benjaminsson avatar Sep 23 '15 09:09 Benjaminsson

Yes, I was bit by this and spent several hours on it. So Kontur, thanks for entering the the issue, and no, for first time users, it's not at all obvious that a project that "Create[s] a basic Gruntfile with grunt-init" fails to create a basic gruntfile that works out of the box. The point of "Hello World", it seems to me, is that it works when you DON'T yet know the environment well, without debugging it.

The way I got rid of the error was to comment out the banner altogether.

JohnLockwood avatar Jun 08 '16 04:06 JohnLockwood

I had this problem also but this issue has been open and unfixed for 5 years so I am guessing this template is dead.

dan-hill avatar Mar 29 '18 03:03 dan-hill