jsreport“在报告初始化期间发生错误”

时间:2018-05-16 21:30:22

标签: jsreport

我只是按照here所述的安装说明在node.js上设置jsreport。一切顺利,直到最后一步:

jsreport start

发生以下错误的地方:

2018-05-16T20:56:19.374Z - info: Initializing jsreport@2.0.0 in development mode using configuration file: jsreport.config.json
2018-05-16T20:56:19.378Z - info: Searching for available extensions in C:\Users\Mauro\
2018-05-16T20:56:19.382Z - info: Extensions location cache not found, crawling directories
2018-05-16T20:56:19.395Z - error: Error occured during reporter init TypeError: Cannot read property 'forEach' of undefined
    at Object.exports.walkSync (C:\Users\Mauro\node_modules\jsreport-core\lib\util\util.js:46:10)
    at Object.get (C:\Users\Mauro\node_modules\jsreport-core\lib\extensions\locationCache.js:22:22)
    at <anonymous>
Error: An error has occurred when trying to initialize jsreport..
    at instance.init.then.catch (C:\Users\Mauro\node_modules\jsreport-cli\lib\instanceHandler.js:31:29)
    at <anonymous> {"originalError":{}}
(Original) TypeError: Cannot read property 'forEach' of undefined
    at Object.exports.walkSync (C:\Users\Mauro\node_modules\jsreport-core\lib\util\util.js:46:10)
    at Object.get (C:\Users\Mauro\node_modules\jsreport-core\lib\extensions\locationCache.js:22:22)
    at <anonymous> {}

我正在尝试在Windows 10上安装。任何解决方法都将受到赞赏。

2 个答案:

答案 0 :(得分:0)

请将jsreport安装到专用目录中 像c:\work\myapp一样 将jsreport安装到您的用户中#39; home目前会导致一些权限问题。

答案 1 :(得分:0)

我找到了一种解决方法,您可以像这样修改...\node_modules\jsreport-core\lib\util.js文件以使jsreport start命令起作用:

enter image description here