excel.js
excel.js copied to clipboard
excel import is not working
var parseXlsx = require('excel'); file = __dirname + '/test/spreadsheets/' + file; parseXlsx(file, function(err, data) { console.log(file); console.log(data); });
+1
Same issue here. Been using older version for a while now successfully, but had to download a new version for a new ubuntu server and the array is always empty. (regardless of spreadsheet used).
There is one excelParser.js in root.Use that file and install respective dependencies. It worked for me. var parseXlsx = require('./excelParser.js') parseXlsx('spreadsheets.xlsx', function(err, data) { console.log(file); console.log(data); });
Everything is working fine on my mac, but on the ubuntu server the results are always empty. Anyone else have this?
@robinvanb Has it ever worked for you on Ubuntu? Is this a new problem for you?
@trevordixon This was my first time deploying it to Ubuntu, are you suggesting it doesn't work on Ubuntu?
I would think it would work on Ubuntu, but I don't think I've ever tried. I'd be very surprised if it's never worked on Ubuntu, but I can't be sure it hasn't.
The only way I could get it working on Ubuntu was to remove the dependencies and reload them afresh (but sorry I forget the exact details)
Ubuntu (gnome): 15.04 Node: v0.12.4
var excel = require("excel");
excel('/path/to.xlsx', function(err, res) {
// todo something with err and res
});
Uncaught exception:
/home/ubuntu/source-module/node_modules/excel/node_modules/node-promise/promise.js:147
throw new Error("This deferred has already been resolved");
+1
Getting an empty array []
for all excel files; doesn't happen on mac
same issue here. working fine on my mac but not working on ubuntu server. any fixes?
Double check your nodejs version. Works fine with me with 0.12 and 4.x, but not with 0.10 (default with some ubuntu installations). When switching node versions (using nvm for example), you mostly have to get rid of node_modules folder and install again.
Getting empty return [ ] on Windows with Node (tried v4 and v6). Put in a little bit of debug logging into extractData() and can see that it is throwing this error:
Error: Could not locate the bindings file. Tried:
→ D:\ ... \node_modules\libxmljs\build\xmljs.node
→ D:\ ... \node_modules\libxmljs\build\Debug\xmljs.node
→ D:\ ... \node_modules\libxmljs\build\Release\xmljs.node
→ D:\ ... \node_modules\libxmljs\out\Debug\xmljs.node
→ D:\ ... \node_modules\libxmljs\Debug\xmljs.node
→ D:\ ... \node_modules\libxmljs\out\Release\xmljs.node
→ D:\ ... \node_modules\libxmljs\Release\xmljs.node
→ D:\ ... \node_modules\libxmljs\build\default\xmljs.node
→ D:\ ... \node_modules\libxmljs\compiled\6.10.0\win32\x64\xmljs.node
at bindings (D:\ ... \node_modules\bindings\bindings.js:88:9)
I can testify to this as well. Using this module on my Mac works fine, but on Ubuntu it produces an empty array.
@anthonyjesmok @timtribers Thanks for looking into it!
Out of curiosity, do you know about https://github.com/SheetJS/js-xlsx? If so, why use excel.js instead of that? I haven't worked on this in a long time, and I wonder if I should just point people to that other option, or if there's something compelling about excel.js that I should make more clear or enhance.
Thanks for responding @trevordixon it is great to hear from you and respond to these issues. I will take a look into js-xlsx and see if that fits my needs.