jsreport / jsreport-compile

Compile jsreport into single executable
2 stars 1 forks source link

Cannot use extensions that are not bundled within the standalone executable. #4

Open kyledevans opened 5 years ago

kyledevans commented 5 years ago

Using jsreport 2.2.0 on Windows 10. I tested this using a fresh install of the standalone executable with the builtin sample reports. The only code modification I made was to add const mssql = require('mssql'); to the Orders script. Then I tried to run Orders template and got the following error:

An error has occurred when trying to initialize jsreport (2). ENOENT: no such file or directory, stat 'C:\projects\jsreport\node_modules\jsreport-compile\node_modules' (1). caused by error (2) -> stack = Error: at instance.init.then.catch ([eval]:43623:29) at tryCatcher (jsreportRuntime.js:146030:23) at Promise._settlePromiseFromHandler (jsreportRuntime.js:145723:31) at Promise._settlePromise (jsreportRuntime.js:145780:18) at Promise._settlePromise0 (jsreportRuntime.js:145825:10) at Promise._settlePromises (jsreportRuntime.js:145900:18) at Async._drainQueue (jsreportRuntime.js:41845:16) at Async._drainQueues (jsreportRuntime.js:41855:10) at Immediate.Async.drainQueues (jsreportRuntime.js:41729:14) at runCallback (timers.js:794:20) at tryOnImmediate (timers.js:752:5) at processImmediate [as _immediateCallback] (timers.js:729:5) caused by error (1) -> meta = {"cause":{"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\projects\jsreport\node_modules\jsreport-compile\node_modules"},"isOperational":true,"errno":-4058,"code":"ENOENT","syscall":"stat","path":"C:\projects\jsreport\node_modules\jsreport-compile\node_modules"}, stack = Error:

It looks like it's hardcoded to look for npm modules in the C:\projects\jsreport\node_modules\jsreport-compile\node_modules directory. In my case I have jsreports running under C:\Users\KEvans\Software\jsreport.

I moved my installation to the directory listed in the error message, and was able to get it working after I also installed the jsreport-compile npm package. I didn't see this dependency in the documentation.