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

  • Home
  • SEARCH
  • 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 8594375
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T00:11:09+00:00 2026-06-12T00:11:09+00:00

I’m working with Mac OS X 10.7.5 and I’m using Grunt to concate some

  • 0

I’m working with Mac OS X 10.7.5 and I’m using Grunt to concate some js files and minify them. Now I want to also minify my css files. As grunt does not provide any functionality I wanted to install a grunt plugin for that.
According to the instructions i have to cd into my projects root folder and install the plugin with npm. So I did the following:

cd <PROJECT_ROOT>
npm install grunt-contrib-css

The instructions for the plugin are here: https://npmjs.org/package/grunt-contrib-mincss
The I opened my grunt.js file and added

grunt.loadNpmTasks('grunt-contrib-mincss');

But when I try to run grunt I just get

Local Npm module "grunt-contrib-mincss" not found. Is it installed?
<WARN> Task "mincss" not found. Use --force to continue. </WARN>

The installation works without any problem and npm ls does list the module.

Any ideas what I have done wrong? Many Thanks!

UPDATED

When I cd into a project like so

cd ~/Sites/path/to/project

and then install the plugin

sudo npm install grunt-contrib-mincss

the module is actually installed in

~/node_modules/grunt-contrib-mincss

I could hard copy the files into my projects root directory (which works) but it’s kind of strange isn’t it?

UPDATE 2
I’ve updated node and tried it again. Below is the console output.

me:~ Fritz$ node -v
v0.8.10
me:~ Fritz$ npm -v
1.1.62
me:~ Fritz$ mkdir ./Sites/npm-test
me:~ Fritz$ cd ./Sites/npm-test/
me:npm-test Fritz$ sudo npm install grunt-contrib-mincss
Password:
npm http GET https://registry.npmjs.org/grunt-contrib-mincss
npm http 304 https://registry.npmjs.org/grunt-contrib-mincss
npm http GET https://registry.npmjs.org/gzip-js
npm http GET https://registry.npmjs.org/clean-css
npm http GET https://registry.npmjs.org/grunt-contrib-lib
npm http 304 https://registry.npmjs.org/gzip-js
npm http 304 https://registry.npmjs.org/clean-css
npm http 304 https://registry.npmjs.org/grunt-contrib-lib
npm http GET https://registry.npmjs.org/crc32
npm http GET https://registry.npmjs.org/deflate-js
npm http GET https://registry.npmjs.org/optimist
npm http 304 https://registry.npmjs.org/deflate-js
npm http 304 https://registry.npmjs.org/crc32
npm http 304 https://registry.npmjs.org/optimist
npm http GET https://registry.npmjs.org/wordwrap
npm http 304 https://registry.npmjs.org/wordwrap
grunt-contrib-mincss@0.3.0 ../../node_modules/grunt-contrib-mincss
├── grunt-contrib-lib@0.3.0
├── gzip-js@0.3.1 (crc32@0.2.2, deflate-js@0.2.2)
└── clean-css@0.4.2 (optimist@0.3.4)

Why is the plugin installed outside? Or is there a way to define the actual location where it is installed?

  • 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-12T00:11:10+00:00Added an answer on June 12, 2026 at 12:11 am

    This way to install worked for me:

    1. cd <PROJECT_ROOT>.
    2. Run npm install grunt-contrib-mincss.
    3. Created test file in the current dir with the following testing content:

      module.exports = function(grunt) {
      
          grunt.initConfig({
              mincss: {
                  compress: {
                      files: {
                          "path/to/output.css": ["path/to/input_one.css", "path/to/input_two.css"]
                      }
                  }
              }
          });
      
          grunt.loadNpmTasks('grunt-contrib-mincss');
      
          grunt.registerTask('default', 'mincss');
      
      };
      
    4. My directory structure looks like this at this moment (please check this, if some files are not there or in some other folder, then it can be reason why it doesn’t work):

      <PROJECT_ROOT> /
          node_modules /
              grunt-contrib-mincss/
          grunt.js
      
    5. Run grunt in terminal.

    Script worked.

    Possible reasons why it didn’t work in your case:

    1. You installed plugin globally (with -g argument).
    2. You installed it in some subfolder (grunt.js and node_modules must be in the same folder).

    Please check it.

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

Sidebar

Related Questions

I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I am reading a book about Javascript and jQuery and using one of 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.