我只是按照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上安装。任何变通方法都将不胜感激。
发布于 2018-05-17 20:45:09
请将jsreport安装到专用目录中。
比如c:\work\myapp。
将jsreport安装到用户的主页会导致当前的一些权限问题。
发布于 2018-05-18 04:21:51
我找到了一个解决方法,您可以像这样修改...\node_modules\jsreport-core\lib\util.js文件以使jsreport start命令正常工作:

https://stackoverflow.com/questions/50380181
复制相似问题