trevordixon / excel.js

Native node.js Excel file parser. Only supports xlsx for now.
MIT License
266 stars 85 forks source link

excel import is not working #30

Open pandeysoni opened 10 years ago

pandeysoni commented 10 years ago

var parseXlsx = require('excel'); file = __dirname + '/test/spreadsheets/' + file; parseXlsx(file, function(err, data) { console.log(file); console.log(data); });

ggomez1973 commented 9 years ago

+1

paroney commented 9 years ago

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).

pandeysoni commented 9 years ago

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); });

robinvanb commented 9 years ago

Everything is working fine on my mac, but on the ubuntu server the results are always empty. Anyone else have this?

trevordixon commented 9 years ago

@robinvanb Has it ever worked for you on Ubuntu? Is this a new problem for you?

robinvanb commented 9 years ago

@trevordixon This was my first time deploying it to Ubuntu, are you suggesting it doesn't work on Ubuntu?

trevordixon commented 9 years ago

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.

paroney commented 9 years ago

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)

gregl83 commented 9 years ago

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"); 
IstoraMandiri commented 8 years ago

+1

Getting an empty array [] for all excel files; doesn't happen on mac

gandhigani commented 8 years ago

same issue here. working fine on my mac but not working on ubuntu server. any fixes?

aularon commented 8 years ago

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.

timtribers commented 7 years ago

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)
anthonyjesmok commented 6 years ago

I can testify to this as well. Using this module on my Mac works fine, but on Ubuntu it produces an empty array.

trevordixon commented 6 years ago

@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.

anthonyjesmok commented 6 years ago

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.