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 8578613
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:25:51+00:00 2026-06-11T20:25:51+00:00

Working on a gruntjs ‘Hello World’ project, and there doesn’t seem to be an

  • 0

Working on a gruntjs ‘Hello World’ project, and there doesn’t seem to be an optimal place to install a grunt task. Say, for instance, that I want to start compiling coffeescript, I would need the ‘grunt-coffee’ task installed.

Option 1: Install it right into my src tree

This seems to be the way grunt would like you to do it, and it works.

cd $MY_PROJECT_HOME
npm install grunt-coffee
grunt coffee

However, this adds 7.2mg to my project tree. I don’t want to put it in my src control, but if I remove it, grunt will not build my project. I could .gitignore it, but then others that download the repository cannot build without doing the same installations. This also gets a bit messy for CI servers.

Option 2: Install it globally

cd $MY_PROJECT_HOME
npm install -g grunt-coffee
grunt coffee

Grunt can’t find my plugins if I install them this way:

Local Npm module "grunt-coffee" not found. Is it installed?

It’s not clear to me why this wouldn’t be supported.

Option 3: Install them somewhere else?

Grunt has an api method called loadTasks, which loads tasks locally. I tried pulling down the npms and moving them myself into a custom directory that I referenced here, with no luck. EG

grunt.loadTasks('$SHARED_TASKS_FOR_ALL_MY_GRUNT_PROJECTS/node_modules/grunt-coffee')

and then:

cd $SHARED_TASKS_FOR_ALL_MY_GRUNT_PROJECTS
npm install grunt-coffee
cd $MY_PROJECT_HOME
grunt coffee

Task "coffee" not found. Use --force to continue.

Option 4: Grunt, in its loadNpmTasks call, pulls down dependencies for me in a .grunt directory somewhere

That’d be nice… 🙂


EDIT

Sindre below is correct. Option 1 is the way to go, but there is one part missing – the package.json file. So:

  • Add a package.json file and put all of your grunt project’s dependencies in there.
  • Ensure that node_modules is .gitignore-ed.
  • In your README, give some instructions to run npm install (note, no arguments) upon a clone or if they add dependencies to the build file.
  • 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-11T20:25:52+00:00Added an answer on June 11, 2026 at 8:25 pm

    First option is the correct way. You don’t commit the node_modules folder, but instead just instruct users to do npm install which fetches all the required dependencies.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using grunt-bbb for a JavaScript project I'm working on. I'd love to use
Working on the problems on Project Euler to try to learn Clojure. I'm on
Working with JSF 2.0 (and Primefaces), is there a way to fire an ActionListener
Working on a project using Entity Framework (4.3.1.0). I'm trying to figure out how
Working on calling a C function from my asm project. I'm trying to push
Working on an old Kohana 2 project and I want to link two models.
Working on a project where I need to add points to an array. Here
Working on a end of the year project for school and chose to create
Working on Ubuntu 10.04 Lucid webserver (linode). Followed these instructions to install wkhtmltopdf link
Working on a project an need a specific effect on the homepage. When a

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.