通过节点窗口运行应用程序时,excel-parser不起作用

时间:2013-09-27 08:05:27

标签: excel node.js

我正在使用节点模块excel-parser解析excel(xsl和xslx)。我使用节点窗口节点模块部署了应用程序。

我正在使用的节点模块:

https://github.com/vxtindia/excel-parser

抛出错误:

code: 1
killed: false
signal: null

如果我正常启动应用程序(节点server.js

,它会工作

我还为excel-parser安装了依赖项:

https://github.com/vxtindia/excel-parser/wiki

excelParser.parse({
      inFile: path.join(exports.rootpath,'/public/data/bizsteps/users/',util.getCurrentUser(req),'/temp/','temperatureLog'+extension),
      worksheet: 1,
      skipEmpty: true
    },function(err, records){ 
      if(err) {
        callback(err,null)
      }else{
          _.each(records,function(element,index){records[index]=_.object(["time","temperature"], [parseFloat(element[0]),parseFloat(element[1])]); });
          callback(null,records);             
      }
    });

以上是我的代码。任何人都可以帮我解决问题和解决办法吗?

1 个答案:

答案 0 :(得分:0)

尝试显式地从shell运行python命令(它显示在节点异常中), 类似的东西:

python /home/michael/projects/some-project/node_modules/excel-parser/convert.py -x /tmp/test.xls

看看它给你带来了什么错误,你可以从那里拿走它。 在我的情况下,我不得不安装xlrd包。如果只是相同的情况: 从这里下载xlrd zip:

https://pypi.python.org/packages/source/x/xlrd/xlrd-0.7.1.zip#md5=851bd20873224d97cfb5ccca2d22b81c

2)解压缩

3)cd to dir

4)sudo python setup.py install