svg-sprite / grunt-svg-sprite

SVG sprites & stacks galore — Grunt plugin wrapping around svg-sprite that reads in a bunch of SVG files, optimizes them and creates SVG sprites and CSS resources in various flavours

Home Page:https://github.com/svg-sprite/svg-sprite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Installation troubles

stefanjudis opened this issue · comments

Hey hey, thanks for the plugin.

I really want to use it, but unfortunately I've got troubles installing it on multiple machines.

logs

Maybe you have any idea what this could be about.

Thanks a lot.

Hi @stefanjudis,

thanks for your report.

Well, it seems you don't have troubles with grunt-svg-sprite itself, but with the installation of libxmljs (which is a dependency). Furthermore, you're obviously not the only person having problems with this. Unfortunately, I'm neither particularly experienced with Node / npm itself, nor with Macs / OSX in general. To cut the long story short: I have no idea how I should help you with this one. :/

When I'm back in the office tomorrow, I will try to install the plugin on OSX and see if I experience the same problems. I'll get back to you then ...

Cheers,
Joschi

Hey Joschi, thanks for quick answer.

I think I got it.

Here is what I did. I forked both of your projects ( svg-sprite & grunt-svg-sprite ).

I changed the path of the binary inside of the package.json of svg-sprite to:

  "bin": {
    "svg-sprite": "./bin/svg-sprite.js"
  },

After that, I changed my version of grunt-svg-sprite to use my version of svg-sprite:

  "dependencies": {
    "svg-sprite": "git://github.com/stefanjudis/svg-sprite.git",
    "chalk": "0.3.x"
  },

When I now run the installation, it works fine:

$ npm install git://github.com/stefanjudis/grunt-svg-sprite.git                                                                                     [23:01:01]
npm http GET https://registry.npmjs.org/chalk
npm http 304 https://registry.npmjs.org/chalk
npm http GET https://registry.npmjs.org/has-color
npm http GET https://registry.npmjs.org/ansi-styles
npm http GET https://registry.npmjs.org/mkdirp
npm http GET https://registry.npmjs.org/async
npm http GET https://registry.npmjs.org/underscore
npm http GET https://registry.npmjs.org/svg-cleaner
npm http GET https://registry.npmjs.org/phantom-sync
npm http GET https://registry.npmjs.org/svgo
npm http GET https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/has-color
npm http 304 https://registry.npmjs.org/ansi-styles
npm http 304 https://registry.npmjs.org/svg-cleaner
npm http 304 https://registry.npmjs.org/phantom-sync
npm http 304 https://registry.npmjs.org/mkdirp
npm http 304 https://registry.npmjs.org/async
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/svgo
npm WARN engine svg-cleaner@0.0.1: wanted: {"node":"0.6.x"} (current: {"node":"v0.10.24","npm":"1.3.21"})
npm http GET https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/make-sync
npm http GET https://registry.npmjs.org/phantom
npm http GET https://registry.npmjs.org/sax
npm http 304 https://registry.npmjs.org/phantom
npm http GET https://registry.npmjs.org/coa
npm http GET https://registry.npmjs.org/js-yaml
npm http GET https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/keypress
npm http GET https://registry.npmjs.org/whet.extend
npm http 304 https://registry.npmjs.org/make-sync
npm http 304 https://registry.npmjs.org/colors
npm http 304 https://registry.npmjs.org/whet.extend
npm http 304 https://registry.npmjs.org/js-yaml
npm http 304 https://registry.npmjs.org/sax
npm http 304 https://registry.npmjs.org/coa
npm http GET https://registry.npmjs.org/coffee-script
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/esprima
npm http GET https://registry.npmjs.org/argparse
npm http GET https://registry.npmjs.org/dnode
npm http GET https://registry.npmjs.org/shoe
npm http GET https://registry.npmjs.org/cssom
npm http GET https://registry.npmjs.org/cheerio
npm http 304 https://registry.npmjs.org/coffee-script
npm http 304 https://registry.npmjs.org/lodash
npm http 304 https://registry.npmjs.org/esprima
npm http 304 https://registry.npmjs.org/argparse
npm http 304 https://registry.npmjs.org/shoe
npm http 304 https://registry.npmjs.org/cssom
npm http 304 https://registry.npmjs.org/dnode
npm http 304 https://registry.npmjs.org/cheerio
npm http GET https://registry.npmjs.org/underscore.string
npm http GET https://registry.npmjs.org/cheerio-select
npm http GET https://registry.npmjs.org/htmlparser2
npm http GET https://registry.npmjs.org/entities
npm http GET https://registry.npmjs.org/dnode-protocol
npm http GET https://registry.npmjs.org/jsonify
npm http GET https://registry.npmjs.org/weak
npm http GET https://registry.npmjs.org/sockjs/0.3.7
npm http 304 https://registry.npmjs.org/underscore.string
npm http 304 https://registry.npmjs.org/jsonify
npm http 304 https://registry.npmjs.org/htmlparser2
npm http 304 https://registry.npmjs.org/entities
npm http 304 https://registry.npmjs.org/dnode-protocol
npm http 304 https://registry.npmjs.org/cheerio-select
npm http 304 https://registry.npmjs.org/weak
npm http 304 https://registry.npmjs.org/sockjs/0.3.7
npm http GET https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/traverse
npm http 304 https://registry.npmjs.org/CSSselect
npm http GET https://registry.npmjs.org/domhandler
npm http GET https://registry.npmjs.org/domutils
npm http GET https://registry.npmjs.org/domelementtype
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/traverse

> weak@0.2.2 install /Users/stefan/node_modules/grunt-svg-sprite/node_modules/svg-sprite/node_modules/phantom-sync/node_modules/phantom/node_modules/dnode/node_modules/weak
> node-gyp rebuild

  CXX(target) Release/obj.target/weakref/src/weakref.o
  SOLINK_MODULE(target) Release/weakref.node
  SOLINK_MODULE(target) Release/weakref.node: Finished
npm http 304 https://registry.npmjs.org/domhandler
npm http GET https://registry.npmjs.org/node-uuid/1.3.3
npm http GET https://registry.npmjs.org/faye-websocket/0.4.4
npm http 304 https://registry.npmjs.org/domutils
npm http 304 https://registry.npmjs.org/domelementtype
npm http 304 https://registry.npmjs.org/node-uuid/1.3.3
npm http 304 https://registry.npmjs.org/faye-websocket/0.4.4
npm http GET https://registry.npmjs.org/CSSwhat
npm http GET https://registry.npmjs.org/boolbase
npm http GET https://registry.npmjs.org/nth-check
npm http 304 https://registry.npmjs.org/CSSwhat
npm http 304 https://registry.npmjs.org/boolbase
npm http 304 https://registry.npmjs.org/nth-check
grunt-svg-sprite@0.0.2 ../../node_modules/grunt-svg-sprite
├── chalk@0.3.0 (ansi-styles@0.2.0, has-color@0.1.4)
└── svg-sprite@0.0.4 (underscore@1.6.0, async@0.2.10, mkdirp@0.3.5, commander@1.0.5, svgo@0.4.4, svg-cleaner@0.0.1, phantom-sync@1.1.1)

I'm a bit confused, because in my mind it should never have worked, but I don't know.
I'll press the PR button now, and maybe this is it.

Thanks. 😄

Hey Stefan,

this sounds great, thanks for debugging! I'll merge your pull request tomorrow morning, please expect a new version before noon!

Btw. there are / were no problems with installing the plugin on Linux. Seems to be a Mac thing ... I will have to check if it still works on Linux, but I guess it will ...

Thanks again, cheers,
Joschi

Hmm, strange...

That sounds awesome, because I wanted to implement it in our pipeline today.
If I can support somehow, please let me know. I'm really looking forward to a spriting solution for grunt. :)

I just need to get back to my office tomorrow - there's no proper IDE here around my couch ;)
I'll get back to you as soon as possible :)

@stefanjudis The new versions are published to the registry now. Please let me know if you encounter additional problems. :)

Perfect... Will play around with it in a few hours.
Thanks a lot for quick response. :)

You're welcome! The medium-term plan is to provide a Grunt / Gulp based version of my iconizr project (resp. http://iconizr.com), so it should be worth staying tuned ;)