win-install reports error of no "start" or "main" script in package.json



  • Hello, I'm trying to install jsreports as a service. I get this from the console

    jsreport win-install
    Platform is win32
    To install app as windows service you need to have a "start" script or a "main" field in package.json file
    

    So then I tried to remedy it by adding the following to my package.json

      "scripts": {
        "start": "jsreport start"
       }
    

    But that doesn't work either because the event view reports the following from nssm:

    Failed to start service jsreport-server.  Program jsreport couldn't be launched. CreateProcess() failed: The system cannot find the file specified.
    

    JS Report CLI version:

    jsreport --version
    cli version: 2.0.7
    

    Can someone help me on what should be in my package.json to get this working correctly?

    Thanks,
    Mike


  • administrators

    i'm not really sure what files you have in your project, but assuming that the entry point of your app is server.js then you can use "start": "node server.js".

    just FYI in case you start a new project, you can do it with jsreport init which creates the package.json with the "scripts" configured properly.



  • Ah, okay I ran jsrpeport init again in an empty directory and I saw the start script does get created. Sorry about that, I must have screwed something up along the way.

    Love the product by the way keep up the good work!


Log in to reply
 

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