drdk / grunt-dr-svg-sprites

Grunt plugin to create SVG sprites with PNG fallbacks at needed sizes
113 stars 19 forks source link

0.2.7 install issue (and solution) #3

Open benfrain opened 10 years ago

benfrain commented 10 years ago

Just did a sudo npm install to bring down the latest changes and got this error:

Error { [Error: Command failed: /bin/sh: /Users/.. .../node_modules/dr-grunt-svg-sprites/node_modules/phantomjs/lib/phantom/bin/phantomjs: Permission denied ] killed: false, code: 126, signal: null }

Seems there is some issue with later issues of Phantomjs. To fix this, I had to 'hard-wire' the dependency version for Phantom in the node-modules/dr-grunt-svg-sprites/ folder to this:

"dependencies": {
    "lodash": "~1.3.1",
    "async": "*",
    "phantomjs": "1.9.0-1",
    "svgo": "*"
  },

Then, after deleting the 'node-modules' folder in 'dr-grunt-svg-sprites' and running sudo npm install in that folder to pull the dependencies back down all is well.

Not sure if this is isolated to my environment but documenting it here in case it helps.

benfrain commented 10 years ago

Just installed 0.53 on a different machine and had this issue again. I think it may be worth making this change to the package.json to stop new users running aground. :)

Although, it's also possible to workaround the issue by running the command as sudo e.g. sudo grunt svg-sprites - that runs without the error.

phloe commented 10 years ago

Error { [Error: Command failed: /bin/sh: /Users/.. .../node_modules/dr-grunt-svg-sprites/node_modules/phantomjs/lib/phantom/bin/phantomjs: Permission denied ] killed: false, code: 126, signal: null }

That sounds vaguely familiar. I think I've experienced something similar in another project that also used PhantomJS in a Grunt buildstep... Sudo seemed to work there too.

I can't currently reproduce the error. I'll mock about with a couple of test projects to see I can recreate it.

Locking the PhantomJS version probably wouldn't hurt (as long as it's one of the versions that fixed the alpha transparency bug on Windows).