Upgrading jsreport to v2 errors out


  • administrators

    hmm according to the error message the cli is not able to find that your directory has jsreport installed, probably the code is getting into some conflict trying to get the correct paths. can you please paste here what is the location of the globally installed cli? i think you can do this in windows to find out which jsreport. also please paste here your project path (i guess it is C:\source\jsreportapp). maybe the global cli and the project path share the same root directory and somehow there is some conflict with that.

    something you can try is to run with the locally installed cli, by using npx jsreport start or node node_modules/.bin/jsreport start



  • Initially, globally installed cli was getting installed in users folder i.e. C:\Users\..\AppData\Roaming\npm. I changed the global location to C:\source\npm\ folder. In both cases, it's not working. This is the current location of globally installed cli

    C:\source\npm\jsreport
    C:\source\npm\jsreport.cmd
    

    My project path is C:\source\jsreportapp


  • administrators

    hmm not sure what happens but it seems to me that the problem is related to having the global modules and the project app sharing the same root location or some permissions error that is not shown, the issue needs debugging with your same folders so i'm not sure we will be able to replicate the problem.

    as a last resource, what is the output of jsreport start --verbose, share all the logs printed maybe there is some information there that can be helpful



  • Here is the output of jsreport start --verbose

    C:\>jsreport start --verbose
    "start" command not found in this installation, check that you are writing the command correctly or check if the command is available in your installation, use "jsreport -h" to see the list of available commands


  • What is your nodejs version? Try it out with the LTS one. https://nodejs.org
    I mean try to uninstall everything and try again.
    You still didn't posted the output of jsreport init. It could be interesting.



  • just downgraded to LTS version. Still seeing same issue, jsreport start and other cli commands are unavailable. Any how, i executed jsreport init script. Here is the output

    C:\source\jsreportapp>jsreport init --verbose
    jsreport installation not found, installing jsreport latest version now, wait a moment...
    jsreport installation finished..
    Creating server.js
    Creating package.json
    Creating default config jsreport.config.json
    Initialized
    

    Node and npm versions

    C:\>node --version
    v8.12.0
    C:\>npm --version
    6.4.1


  • Hm. That looks good. Can you zip the jsreportapp an upload it somewhere?





  • Why do you have in that folder jsreport.exe?



  • i added jsreport.exe because jsreport start does not work with jsreport-cli (an issue stated above). When i use jsreport.exe start, i am able to start the server



  • The structure of node_modules isn't flattened. This is not the way how the npm installs it by default.
    This is the way how npm v2 installs modules. Haven't you done any configuration to the npm?

    I would recommend to delete package-lock.json, node_modules and jsreport.exe.

    Then type npm install . The jsreport start should work afterwards. If you have properly working npm.



  • Thank you for your help. I turned off npm legacy-bundling and it worked!!


Log in to reply
 

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