Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript NodeJ比较两个不同的excel文件并找出它们的差异_Javascript_Node.js_Excel_Typeerror - Fatal编程技术网

Javascript NodeJ比较两个不同的excel文件并找出它们的差异

Javascript NodeJ比较两个不同的excel文件并找出它们的差异,javascript,node.js,excel,typeerror,Javascript,Node.js,Excel,Typeerror,这是我的第一个问题。如果我错了,请纠正我。我是诺德的新蜜蜂。我试图通过nodejs比较两个excel文件。我使用excel比较模块比较了两个excel文件(实际上有多张工作表)。但它的抛出类型错误。这是我的密码 var excel_compare = require("excel-compare"); excel_compare({ file1: 'data/school.xlsx', // file1 is the main excel to compare with file

这是我的第一个问题。如果我错了,请纠正我。我是诺德的新蜜蜂。我试图通过nodejs比较两个excel文件。我使用excel比较模块比较了两个excel文件(实际上有多张工作表)。但它的抛出类型错误。这是我的密码

var excel_compare = require("excel-compare");
excel_compare({
    file1: 'data/school.xlsx', // file1 is the main excel to compare with
    file2: 'data/all.xlsx', // file2 is the file for compare
    column_file1: {
        column: [1],
        join: ''
    },
    column_file2: {
        column: [2],
        join: '-'
    }
})
当我运行上面的代码时,我得到以下错误

TypeError: Cannot read property 'value' of undefined
    at E:\node_modules\npm\node_modules\excel-compare\index.js:17:35
    at Array.forEach (native)
    at Function._.each._.forEach (E:\node_modules\npm\node_modules\excel-compare
\node_modules\underscore\underscore.js:79:11)
    at E:\node_modules\npm\node_modules\excel-compare\index.js:15:5
    at Function._.each._.forEach (E:\node_modules\npm\node_modules\excel-compare
\node_modules\underscore\underscore.js:82:22)
    at module.exports (E:\node_modules\npm\node_modules\excel-compare\index.js:1
3:4)
    at Object.handle (E:\node_modules\npm\Excel\excelread.js:39:2)
    at next_layer (E:\node_modules\npm\node_modules\express\lib\router\route.js:
103:13)
    at Route.dispatch (E:\node_modules\npm\node_modules\express\lib\router\route
.js:107:5)
    at E:\node_modules\npm\node_modules\express\lib\router\index.js:213:24

有人能帮我解决这个问题吗?

看看上面的示例,看起来您没有正确指定列。尝试使用数值。我认为如果不对源代码做一些更改,您无法比较两个工作表


希望这有帮助。

当我尝试使用数值时,我得到了以下错误类型错误:无法读取未定义的属性“1”。@user3708542:确保使用的是数值而不是字符串值:
列:[1]
而不是
列:[1']
以正确的方式尝试,我的意思是列:[1] @sholanozie@user3708542:真奇怪。您的计算机上是否存在文件
data/school.xslx
data/all.xslx
?对不起,这个明显的问题!哈哈,它存在@sholanozie