Upgrading jsreport to v2 errors out
-
Just found out that when I use
jsreport start
locally from.bin
direcotry, I see "start" option. However when I call it globally usingjsreport start
, command is unavailable. Please help!!
-
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 isC:\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
ornode 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 toC:\source\npm\
folder. In both cases, it's not working. This is the current location of globally installed cliC:\source\npm\jsreport C:\source\npm\jsreport.cmd
My project path is
C:\source\jsreportapp
-
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 ofjsreport 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 executedjsreport init
script. Here is the outputC:\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?
-
shared my folder here.
https://drive.google.com/file/d/1YoADIxqEyn7PAUgVQeiLpeuftDSgjy-a/view?usp=sharing
-
Why do you have in that folder
jsreport.exe
?
-
i added
jsreport.exe
becausejsreport start
does not work with jsreport-cli (an issue stated above). When i usejsreport.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
andjsreport.exe
.Then type
npm install
. Thejsreport start
should work afterwards. If you have properly working npm.
-
Thank you for your help. I turned off npm
legacy-bundling
and it worked!!