Npm module "grunt-contrib-imagemin" not found, Is it installed?

19,678

Solution 1

Ok I found a way to solve this:

  • In your package.json, add "jpegtran-bin": "0.2.0" before the reference to imagemin
  • Delete the node_modules folder in your project, and run "npm install" and "bower install" again

There seem to be an issue with the jpegtran's latest version.

!! - Please note this is just a workarround waiting for the bugfix.

Solution 2

Like the program suggests, you need to install the npm module.

npm i --save-dev grunt-contrib-imagemin

Considering you're on Windows you might want to take a look at the project's GitHub repo for additional installation instructions.

Solution 3

I had the same problem with 0.3.0 version, but once I updated to 0.4.0 the problem was solved. Check your package.json. Hope that helps!

"grunt-contrib-imagemin": "~0.4.0",

Solution 4

There's an issue with a package contrib-imagemin references that prevents it from properly installing on Windows.

GitHub issue on grunt-contrib-imagemin: https://github.com/gruntjs/grunt-contrib-imagemin/issues/109

GitHub pull request on the offending library: https://github.com/yeoman/node-jpegtran-bin/pull/38

For now, you can manually specify "jpegtran-bin": "0.2.0" in your package.json and it should function as a workaround. If it's a pain point for you, go comment on that pull request and perhaps it'll convince the project maintainer to actually take a look and comment as well.

Solution 5

As of May 2015 I solved this by deleting node_modules and running npm install.

Share:
19,678

Related videos on Youtube

jsidera
Author by

jsidera

Updated on August 28, 2020

Comments

  • jsidera
    jsidera over 3 years

    I run into this error, when I try to do build a project with "grunt build".

    Screenshot

    There seems to be no problem when I test the project by doing "grunt server".

    The project has been scaffolded and managed with: yeoman/grunt/bower. In Windows.

    Everything went well and then a week ago or so it started doing this. I can't build projects no more.

    When I try to install the module doing:

    npm install grunt-contrib-imagemin
    

    It can never install it, get the following "weird" error.

    enter image description here

    Any hints please?

  • Hugo H
    Hugo H over 10 years
    It works for me too. Please note it's just a workaround waiting a bugfix. :)
  • Dejell
    Dejell over 9 years
    I am using version 0.7.1 and still get it
  • William Turrell
    William Turrell over 8 years
    I had the problem when I already had 0.4.0, so I'm not sure it's that…