Create JSreport client server

  • Hello.
    I create jsreport to generate PDF is OK now.
    I use PKG npm newest version to create EXE file that run a jsreport server.
    with command: pkg server.js


    const jsreport = require('jsreport')()
    const fs = require('fs')
    if (process.env.JSREPORT_CLI) {
      // export jsreport instance to make it possible to use jsreport-cli
      module.exports = jsreport
    } else {
      jsreport.init().then(() => {
        // running
      }).catch((e) => {
        // error during startup
        fs.writeFileSync("log.txt", e.stack)


    "httpPort": 5488,
    "store": {
    	"provider": "memory"
    "blobStorage": {
    	"provider": "memory"
    "logger": {
    	"console": {
    		"transport": "console",
    		"level": "debug"
    "allowLocalFilesAccess": true,
    "reportTimeout": 600000,
    "templatingEngines": {
    	"numberOfWorkers": 4,
    	"strategy": "http-server"
    "chrome": {
    	"launchOptions": {
    		"args": []
    "extensions": {
    	"authentication": {
    		"cookieSession": {
    			"secret": "secret_string"
    		"admin": {
    			"username": "admin",
    			"password": "jsreport"
    		"enabled": true
    	"scripts": {
    		"strategy": "http-server"

    The problem is it's ok to start.
    In the image:
    1 -> successful init
    2 -> error i got when create PDF with server running by file created by PKG
    (with server running by node server.js its OK)

    Anyone have an experiment about this issue ?

  • Compiling jsreport (or other complex nodejs apps) into exe is much more complicated.
    You can either download our already compiled distribution

    Or try to use our code that leverages pkg to compile:

    jsreport v2

    jsreport v3

  • OK. Now i understand that pkg not resolve my problem.

    I tried to download this one ( but it cant start. When i open it open command line window and shutdown (exit) imediately. Is that any special in there ?

Log in to reply

Looks like your connection to jsreport forum was lost, please wait while we try to reconnect.