Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't make it work anymore #214

Closed
mtt87 opened this issue May 7, 2014 · 16 comments
Closed

Can't make it work anymore #214

mtt87 opened this issue May 7, 2014 · 16 comments

Comments

@mtt87
Copy link

mtt87 commented May 7, 2014

Starting from yo + webapp generator 0.4.9 I can't make it work anymore.
The first error I can see is this:

> optipng-bin@0.3.8 postinstall /Users/mattia.asti/Web/TechHub/test_yo/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/optipng-bin
> node index.js


module.js:340
    throw err;
          ^
Error: Cannot find module 'lodash'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.Module._load (module.js:280:25)
    at Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object. (/Users/mattia.asti/Web/TechHub/test_yo/node_modules/grunt-contrib-imagemin/node_modules/image-min/node_modules/map-key/index.js:3:12)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:364:17)
npm WARN optional dep failed, continuing optipng-bin@0.3.8

The first time I run grunt build I receive this error:

Warning: Running "imagemin:dist" (imagemin) task
    Warning: Cannot find module 'optipng-bin' Use --force to continue.
    
    Aborted due to warnings.

Then I try to install it with npm install --save-dev optipng-bin it the installation process is fine.

Then I try to do grunt buildbut it's failing again, if I run grunt imagemin -verbose this is the output:

Running "imagemin:dist" (imagemin) task
Verifying property imagemin.dist exists in config...OK
Files: ... -> ...
Options: optimizationLevel=7, progressive
Warning: Bad argument Use --force to continue.

I'm going crazy I don't know actually how to solve this, any help it's really appreciated.

@mtt87
Copy link
Author

mtt87 commented May 7, 2014

Just tried npm cache clean && npm install gruntjs/grunt-contrib-imagemin and looks like it's working again.

Still I can't explain what happened

@richardwestenra
Copy link

@mtt87 Thanks for the fix.

I updated yo, bower and generator-webapp yesterday and started a new project, and imagemin began throwing an error when compiling the build, whenever there are images in the 'images' folder. It happens with any images, and it also happens when I start a fresh project without changing anything except adding images to minify.
If I only have a PNG in the folder the warning is Warning: Bad argument.
If I only have a JPG in the folder the warning is Warning: Cannot find module 'jpegtran-bin'.
I'm using yo v1.1.2, and webapp-generator v0.4.9, and I'm on OSX Mavericks.

Fix: I ran npm cache clean and npm install grunt-contrib-imagemin and now it's working fine.

Note: When reinstalling, it gave the following error:

✗ pre-build test failed, compiling from source...
✗ Error: Command failed: In file included from pngquant.c:59:
./rwpng.h:35:10: fatal error: 'png.h' file not found
#include "png.h"    /* libpng header; includes zlib.h */
         ^
1 error generated.
make: *** [pngquant.o] Error 1

@kevva
Copy link
Member

kevva commented May 9, 2014

@pdelorme
Copy link

pdelorme commented Jun 6, 2014

thanks @mtt87. cleaning cache does the job.

@mgogov
Copy link

mgogov commented Aug 1, 2014

+1 for cleaning the cache and reinstalling

@sarith
Copy link

sarith commented Aug 13, 2014

+1 clean + reinstall worked

@mhirst
Copy link

mhirst commented Aug 13, 2014

worked for me as well. thank you.

@narayanwaraich
Copy link

@mtt87 works for me, thanks

@antoineclaval
Copy link

Frustrating, but cleaning cache and re-installing imagemin work also for me.

@jsgv
Copy link

jsgv commented Sep 6, 2014

I uninstall it then I npm cache clear and re-install. But I continue to get the same error.

⚠ pre-build test failed, compiling from source...
✖ { [Error: Command failed: ./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
./configure: line 311: test: /Volumes/Macintosh: binary operator expected
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
rm: conftest.dSYM: is a directory
configure: error: configuration problem: maybe object file format mismatch.
] killed: false, code: 1, signal: null }

@budmc29
Copy link

budmc29 commented Sep 26, 2014

After searching for hour and npm cache clean and npm install grunt-contrib-imagemin not working i found a solution:

npm cache clean && npm install gruntjs/grunt-contrib-imagemin
+
$ npm install --save imagemin-optipng (because i had an error and send it was missing optipng)

@MardariG
Copy link

budmc29. Thanks, finally geted it to work.

@cesarvega
Copy link

@jesusjjf solution work for me after I try the ones above thanks

@hexinatgithub
Copy link

This right, this problem cause me crazy.I try to start the new project, but this is also fail.Then try
npm cache clean && npm install gruntjs/grunt-contrib-imagemin
this work, don't know why, waste a day.

@chandramuralis
Copy link

+1 below worked for me too
npm cache clean && npm install gruntjs/grunt-contrib-imagemin

@lucasruy
Copy link

lucasruy commented Aug 7, 2017

+1 below worked for me too
npm cache clean && npm install gruntjs/grunt-contrib-imagemin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests