Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8689883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:46:08+00:00 2026-06-12T23:46:08+00:00

I am working on my own boilerplate using grunt’s CLI possibilities like so grunt

  • 0

I am working on my own boilerplate using grunt’s CLI possibilities like so grunt init:webdesign-project – for this I created a folder named webdesign-project within node_modules/grunt/init and a corresponding webdesign-project.js file. So far everything works great.

Now I wanted to insert my own “questions” with the grunt.helper function like this

grunt.helper('prompt_for', 'img_path', 'img')

however this gives me

TypeError: Cannot set property 'name' of undefined
at Object.module.exports.grunt.registerHelper.grunt.utils.spawn.cmd (/usr/lib/node_modules/grunt/tasks/init.js:573:17)
at Task.helper (/usr/lib/node_modules/grunt/lib/util/task.js:117:19)
at Object.exports.template (/usr/lib/node_modules/grunt/tasks/init/webdesign-project.js:30:11)
at Object.module.exports.grunt.registerHelper.done (/usr/lib/node_modules/grunt/tasks/init.js:240:27)
at Object.task.registerTask.thisTask.fn (/usr/lib/node_modules/grunt/lib/grunt/task.js:58:16)
at Task.<anonymous> (/usr/lib/node_modules/grunt/lib/util/task.js:341:36)
at Task.start (/usr/lib/node_modules/grunt/lib/util/task.js:357:5)
at Object.grunt.tasks (/usr/lib/node_modules/grunt/lib/grunt.js:143:8)
at Object.module.exports [as cli] (/usr/lib/node_modules/grunt/lib/grunt/cli.js:36:9)
at Object.<anonymous> (/usr/lib/node_modules/grunt/bin/grunt:19:14)

Isn’t it possible to define your own variables using this function?

EDIT: Does anybody know if a documentation for this function exists? (Couldn’t find one yet)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T23:46:09+00:00Added an answer on June 12, 2026 at 11:46 pm

    I figured out how to achieve the “custom prompt” – in case anybody is interested:

    Grunt’s grunt.helper('prompt_for', '...') function apparently only takes a predefined set of values in lieu of ‘…’. Actually this should not be surprising, as there are some pretty unique features for some of those values (e.g. when you’ve entered testproject as your project’s name, “(git://github.com/peter/testproject.git)” will automatically be proposed.

    Solution: Take a look at the .js file of the gruntfile template (node_modules/grunt/tasks/init/gruntfile.js) – creating a custom prompt goes like this:

    {
      name: 'img_path',
      message: 'Name the folder where all image files are located',
      default: 'img',
      // warning: '' couldn't find any use for this optional property
    }
    

    instead of

    grunt.helper('prompt_for', 'img_path', 'img')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working on my own django based blog (like everyone, I know) to
I am working with Integration of multiple applications which is using their own databases.
I am currently working on my own version of membership using Entity Framework 4.0
I'm working on my own python testing framework which I'd like to use within
I'm working on my own open-source project. I've recently released the first workable version
I'm currently working on my own memory leak tracking system. I'm using Microsoft Visual
I'm a web developer working on my own using django, and I'm trying to
I'm just starting out using Subversion on a C# project. I am working on
I have started working on my own project, but I am stuck due to
I copy-pasted this code from my own previous working document, so I know the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.