selaux / node-sprite-generator

Generates image sprites and their spritesheets (css, stylus, sass or less) from sets of images. Supports retina sprites. Provides express middleware and grunt task.
MIT License
192 stars 39 forks source link

Bad compositor / incorrect dependencies even though GraphicsMagick is installed #58

Closed weedgrease closed 7 years ago

weedgrease commented 7 years ago

Hey there, I just got this stack trace on my AppVeyor build all of a sudden - happens intermittently which is confusing:

The Broccoli Plugin: [object Object] failed with:
Error: Either you defined a bad compositor or you dont have the correct dependencies installed.
    at generateSprite (C:\projects\dashboard\node_modules\node-sprite-generator\lib\nsg.js:66:25)
    at C:\projects\dashboard\node_modules\broccoli-sprite\index.js:56:5
    at initializePromise (C:\projects\dashboard\node_modules\rsvp\dist\rsvp.js:589:5)
    at new Promise$1 (C:\projects\dashboard\node_modules\rsvp\dist\rsvp.js:1077:33)
    at BroccoliSprite.updateCache (C:\projects\dashboard\node_modules\broccoli-sprite\index.js:55:17)
    at C:\projects\dashboard\node_modules\broccoli-sprite\node_modules\broccoli-caching-writer\index.js:49:36
    at lib$rsvp$$internal$$tryCatch (C:\projects\dashboard\node_modules\broccoli-sprite\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:493:16)
    at lib$rsvp$$internal$$invokeCallback (C:\projects\dashboard\node_modules\broccoli-sprite\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:505:17)
    at C:\projects\dashboard\node_modules\broccoli-sprite\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1001:13
    at lib$rsvp$asap$$flush (C:\projects\dashboard\node_modules\broccoli-sprite\node_modules\broccoli-caching-writer\node_modules\rsvp\dist\rsvp.js:1198:9)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Here's my GraphicsMagick version:

gm version
GraphicsMagick 1.3.25 2016-09-05 Q16 http://www.GraphicsMagick.org/
Copyright (C) 2002-2016 GraphicsMagick Group.
Additional copyrights and licenses apply to this software.
See http://www.GraphicsMagick.org/www/Copyright.html for details.
Feature Support:
  Native Thread Safe       yes
  Large Files (> 32 bit)   yes
  Large Memory (> 32 bit)  yes
  BZIP                     yes
  DPS                      no
  FlashPix                 no
  FreeType                 yes
  Ghostscript (Library)    no
  JBIG                     yes
  JPEG-2000                yes
  JPEG                     yes
  Little CMS               yes
  Loadable Modules         yes
  OpenMP                   yes (200203)
  PNG                      yes
  TIFF                     yes
  TRIO                     no
  UMEM                     no
  WebP                     yes
  WMF                      yes
  X11                      no
  XML                      yes
  ZLIB                     yes
Windows Build Parameters:
  MSVC Version:            1500

Not sure what else could cause this issue besides a bad gm installation, but it seems fine. Any ideas?

selaux commented 7 years ago

Can you check if an error is catched here and what it is? https://github.com/selaux/node-sprite-generator/blob/2b51f7880dfc9131c0a3499f5a4f2845e97f6e79/lib/nsg.js#L38

weedgrease commented 7 years ago
trying to require gm
{ Error: Cannot find module 'gm'
    at Function.Module._resolveFilename (module.js:469:15)
    at Function.Module._load (module.js:417:25)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (C:\projects\node-sprite-generator\lib\compositor\gm.js:7:10)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3) code: 'MODULE_NOT_FOUND' }

Looked for it in the tree but couldn't see it trying to get installed either.

selaux commented 7 years ago

Can you try installing it manually, it is an optional dependency thus npm install might not have raised an error if it cannot install.

weedgrease commented 7 years ago

Where do you want me to try and install it? Globally or within node-sprite-generator?

selaux commented 7 years ago

The gm module within node-sprite-generator

selaux commented 7 years ago

@kevingelion Any update?