rse / node-prince

Node API for executing PrinceXML via prince(1) CLI
https://npmjs.com/prince
49 stars 24 forks source link

Installation error on Linux CI build server #8

Closed timtribers closed 8 years ago

timtribers commented 8 years ago

Hi @rse ,

I'm using grunt-princess on node which is working great locally. However, when I try to automate it on a CI server (Ubuntu 14.04.3 LTS) I get the following error message.

> node ./prince-npm.js install

++ checking for globally installed PrinceXML
++ downloading PrinceXML distribution
ERROR: failed to determine platform details on platform "x64-linux"
npm ERR! Linux 3.19.0-51-generic
npm ERR! argv "/root/.nvm/versions/node/v0.12.15/bin/node" "/root/.nvm/versions/node/v0.12.15/bin/npm" "install"
npm ERR! node v0.12.15
npm ERR! npm  v2.15.1
npm ERR! code ELIFECYCLE

npm ERR! prince@1.2.0 install: `node ./prince-npm.js install`
npm ERR! Exit status 1

A quick look at your code, suggests to me that there's a problem running

sh + __dirname + /shtool platform -t binary

I put into my build script, near the top, a specific

sudo apt-get install -y shtool

to ensure it's there, but I still get the same error.

Any ideas what else I could try?

Thanks

timtribers commented 8 years ago

And here's an update. . .

I managed to get it working by scripting my own install first:

sudo apt-get install -y libgif4 sudo apt-get install -y aptitude sudo aptitude install -y gdebi wget http://www.princexml.com/download/prince_10r7-1_ubuntu14.04_amd64.deb sudo gdebi --non-interactive prince_10r7-1_ubuntu14.04_amd64.deb

Then I run node/grunt. And now the logs show:

> node ./prince-npm.js install
++ checking for globally installed PrinceXML
-- found prince(1) command: /usr/bin/prince
-- found prince(1) version: 10

And I get a pdf generated :)

Still don't know why the other 'normal' way didn't work, but hey, I'm happy (or will be, when I get my pdf to look the way I want - but think that is my problem).

Sorry to have bothered you.