packaging node js code gives phantom js warning










0















I need to generate a PDF which contains graph in node js server side . I have used d3js server side concept inorder to create an svg. svg2png npm library helps in converting svg to image and am amble to get graph in PDF. Now i need to create exe for the node js code where i am getting phantom js warning



This is the warning Im getting:




Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs
path-to-executable/phantom/phantomjs
Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs.exe
path-to-executable/phantom/phantomjs.exe




exe is getting created. But exe is not converting svg to png. How can i solve this warning???



This is my code for converting svg to png



const fs = require("pn/fs"); // https://www.npmjs.com/package/pn
const svg2png = require("svg2png");

fs.readFile("source.svg")
.then(svg2png)
.then(buffer => fs.writeFile("dest.png", buffer))
.catch(e => console.error(e));


Any help will be great. Thanks in advance.










share|improve this question
























  • What are you using to compile as an executable? A quick peruse of the dependencies of svg2png shows phantomjs-prebuilt, which is basically an executable program. There are in fact quite a lot of "modules" on npm which actually simply "launch external programs" and gather the output. This basically looks like one of those, and hence the issue with attempting to compile an "executable" into your own "executable". Perhaps you should consider than not compiling as executable might be a good thing.

    – Neil Lunn
    Nov 14 '18 at 6:40











  • Im using pkg comment to compile as an executable. So it seems like i cannot compile it to exe. @Neil Lunn

    – Jyothi
    Nov 14 '18 at 6:43
















0















I need to generate a PDF which contains graph in node js server side . I have used d3js server side concept inorder to create an svg. svg2png npm library helps in converting svg to image and am amble to get graph in PDF. Now i need to create exe for the node js code where i am getting phantom js warning



This is the warning Im getting:




Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs
path-to-executable/phantom/phantomjs
Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs.exe
path-to-executable/phantom/phantomjs.exe




exe is getting created. But exe is not converting svg to png. How can i solve this warning???



This is my code for converting svg to png



const fs = require("pn/fs"); // https://www.npmjs.com/package/pn
const svg2png = require("svg2png");

fs.readFile("source.svg")
.then(svg2png)
.then(buffer => fs.writeFile("dest.png", buffer))
.catch(e => console.error(e));


Any help will be great. Thanks in advance.










share|improve this question
























  • What are you using to compile as an executable? A quick peruse of the dependencies of svg2png shows phantomjs-prebuilt, which is basically an executable program. There are in fact quite a lot of "modules" on npm which actually simply "launch external programs" and gather the output. This basically looks like one of those, and hence the issue with attempting to compile an "executable" into your own "executable". Perhaps you should consider than not compiling as executable might be a good thing.

    – Neil Lunn
    Nov 14 '18 at 6:40











  • Im using pkg comment to compile as an executable. So it seems like i cannot compile it to exe. @Neil Lunn

    – Jyothi
    Nov 14 '18 at 6:43














0












0








0








I need to generate a PDF which contains graph in node js server side . I have used d3js server side concept inorder to create an svg. svg2png npm library helps in converting svg to image and am amble to get graph in PDF. Now i need to create exe for the node js code where i am getting phantom js warning



This is the warning Im getting:




Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs
path-to-executable/phantom/phantomjs
Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs.exe
path-to-executable/phantom/phantomjs.exe




exe is getting created. But exe is not converting svg to png. How can i solve this warning???



This is my code for converting svg to png



const fs = require("pn/fs"); // https://www.npmjs.com/package/pn
const svg2png = require("svg2png");

fs.readFile("source.svg")
.then(svg2png)
.then(buffer => fs.writeFile("dest.png", buffer))
.catch(e => console.error(e));


Any help will be great. Thanks in advance.










share|improve this question
















I need to generate a PDF which contains graph in node js server side . I have used d3js server side concept inorder to create an svg. svg2png npm library helps in converting svg to image and am amble to get graph in PDF. Now i need to create exe for the node js code where i am getting phantom js warning



This is the warning Im getting:




Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs
path-to-executable/phantom/phantomjs
Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
node_modulesphantomjs-prebuiltlibphantombinphantomjs.exe
path-to-executable/phantom/phantomjs.exe




exe is getting created. But exe is not converting svg to png. How can i solve this warning???



This is my code for converting svg to png



const fs = require("pn/fs"); // https://www.npmjs.com/package/pn
const svg2png = require("svg2png");

fs.readFile("source.svg")
.then(svg2png)
.then(buffer => fs.writeFile("dest.png", buffer))
.catch(e => console.error(e));


Any help will be great. Thanks in advance.







node.js phantomjs






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 14 '18 at 6:44









Neil Lunn

97.8k23174184




97.8k23174184










asked Nov 14 '18 at 6:28









JyothiJyothi

158




158












  • What are you using to compile as an executable? A quick peruse of the dependencies of svg2png shows phantomjs-prebuilt, which is basically an executable program. There are in fact quite a lot of "modules" on npm which actually simply "launch external programs" and gather the output. This basically looks like one of those, and hence the issue with attempting to compile an "executable" into your own "executable". Perhaps you should consider than not compiling as executable might be a good thing.

    – Neil Lunn
    Nov 14 '18 at 6:40











  • Im using pkg comment to compile as an executable. So it seems like i cannot compile it to exe. @Neil Lunn

    – Jyothi
    Nov 14 '18 at 6:43


















  • What are you using to compile as an executable? A quick peruse of the dependencies of svg2png shows phantomjs-prebuilt, which is basically an executable program. There are in fact quite a lot of "modules" on npm which actually simply "launch external programs" and gather the output. This basically looks like one of those, and hence the issue with attempting to compile an "executable" into your own "executable". Perhaps you should consider than not compiling as executable might be a good thing.

    – Neil Lunn
    Nov 14 '18 at 6:40











  • Im using pkg comment to compile as an executable. So it seems like i cannot compile it to exe. @Neil Lunn

    – Jyothi
    Nov 14 '18 at 6:43

















What are you using to compile as an executable? A quick peruse of the dependencies of svg2png shows phantomjs-prebuilt, which is basically an executable program. There are in fact quite a lot of "modules" on npm which actually simply "launch external programs" and gather the output. This basically looks like one of those, and hence the issue with attempting to compile an "executable" into your own "executable". Perhaps you should consider than not compiling as executable might be a good thing.

– Neil Lunn
Nov 14 '18 at 6:40





What are you using to compile as an executable? A quick peruse of the dependencies of svg2png shows phantomjs-prebuilt, which is basically an executable program. There are in fact quite a lot of "modules" on npm which actually simply "launch external programs" and gather the output. This basically looks like one of those, and hence the issue with attempting to compile an "executable" into your own "executable". Perhaps you should consider than not compiling as executable might be a good thing.

– Neil Lunn
Nov 14 '18 at 6:40













Im using pkg comment to compile as an executable. So it seems like i cannot compile it to exe. @Neil Lunn

– Jyothi
Nov 14 '18 at 6:43






Im using pkg comment to compile as an executable. So it seems like i cannot compile it to exe. @Neil Lunn

– Jyothi
Nov 14 '18 at 6:43













0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53294283%2fpackaging-node-js-code-gives-phantom-js-warning%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53294283%2fpackaging-node-js-code-gives-phantom-js-warning%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Top Tejano songwriter Luis Silva dead of heart attack at 64

政党

天津地下鉄3号線