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
191 stars 39 forks source link

Sprite image and style does not generated #72

Open hilo2120 opened 6 years ago

hilo2120 commented 6 years ago

Here is my code:

var nsg = require('node-sprite-generator');
  nsg({
      src: ['images/1.jpg',
        'images/2.jpg',
        'images/3.jpg'
      ],
      spritePath: 'sprite.png',
      stylesheetPath: 'sprite.css',
      stylesheet: 'css'
  }, function (err) {
      console.log('Sprite generated!');
  });

When i run it using node sprite.js It says "Sprite generated!" but nothing happens, there is no sprite.png and no sprite.css! I'm using vscode internal terminal.

m0o0scar commented 5 years ago

I encounter similiar issue, printing the error object of the callback function shows:

TypeError: expecting a function but got [object Null]
    at apiRejection (/.../node_modules/bluebird/js/release/promise.js:10:27)
    at map (/.../node_modules/bluebird/js/release/map.js:136:16)
    at Promise.map (/.../node_modules/bluebird/js/release/map.js:160:12)
    at generateSprite (/.../node_modules/node-sprite-generator/lib/spriteGenerator.js:74:10)
    at generateSpriteNode (/.../node_modules/node-sprite-generator/lib/index.js:15:12)
    at Object.<anonymous> (/.../scripts/spritesheet.js:17:1)
    at Module._compile (internal/modules/cjs/loader.js:701:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:712:10)
    at Module.load (internal/modules/cjs/loader.js:600:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
    at Function.Module._load (internal/modules/cjs/loader.js:531:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)