meteor,使用xlsx填充写入xlsx文件

meteor,使用xlsx填充写入xlsx文件,meteor,xlsx,Meteor,Xlsx,我正在使用xlsx填充操作meteor应用程序服务器端的文件。下面的代码是我如何尝试这样做,但它给出了一个错误 writeFile : function(dict){ XlsxPopulate.fromFileAsync("assets/app/PlanningTemplate.xlsx"). then(workbook => { const sheet = workbook.sheet("Sheet1"); Object.keys(dict

我正在使用xlsx填充操作meteor应用程序服务器端的文件。下面的代码是我如何尝试这样做,但它给出了一个错误

writeFile : function(dict){
    XlsxPopulate.fromFileAsync("assets/app/PlanningTemplate.xlsx").
    then(workbook => {
        const sheet = workbook.sheet("Sheet1");
        Object.keys(dict).forEach(function(key) {
            sheet.cell(key).value(dict[key]);
        });
        workbook.toFileAsync("assets/app/PlanningTemplate.xlsx");
    })                  
}
错误如下所示:

unhandledPromiseRejectionWarning: unhandled promise rejection <rejection id: 1>: Error: EPERM: operation not permitted open C:\.....
未处理的PromisejectionWarning:未处理的承诺拒绝:错误:EPERM:不允许操作打开C:\。。。。。

然而,我编写了读取文件的代码,这很好,但是我似乎无法使它在写入同一个文件时工作。

基本上,您不应该尝试写入文件系统。当您将其部署到docker image时,文件系统将是只读的,因此您必须添加一个可写卷。使用Ostrio:files这样的包进行文件访问更容易

如果您仍然想写入文件系统,您必须记住meteor在.meteor/local中构建映像并运行服务器。。。因此,您应该使用绝对文件路径,而不是相对文件路径