Open vytjan opened 10 years ago
@vytas00 Can you share a small test case (the code to generate the file as well as the 1.xlsx file)?
Here's the test code: http://pastebin.com/wt6Firr3 I understand the problem may be in xlsx-to-json module when it reads xlsx file, but I can't get to it. P.S. Thanks for fast answer.
Your code works fine for me on node 0.10.29 using version 0.0.2 of msexcel-builder and version 0.2.3 of xlsx-to-json on OSX 10.9.3:
$ node --version
v0.10.29
$ npm ls -g | grep msexcel-builder
├─┬ msexcel-builder@0.0.2
$ npm ls -g | grep xlsx-to-json
├─┬ xlsx-to-json@0.2.3
$ node test.js
[ { Surname: 'Doe', Name: 'John' },
{ Surname: 'Doe', Name: 'Jane' } ]
2
Weird, my code also works on Ubuntu and Amazon Linux fine. So I guess it's some specific Windows 8.1 problem. @arabesq, do you have any guess what could it be?
Remove both modules, delete your .npm directory (that directory caches modules) and then reinstall both and try again.
In general, when I notice a strange issue like this, where a module works in one place but not another, I go back and try to start from a clean slate.
I faced a problem while using ms-excel module and don't know how to fix it. I create a 1.xlsx file with msexcel-builder module and I am trying to put the data from 1.xlsx to 2.json using other module(xlsx-to-json), but 2.json file is being created empty. However, if I copy content of 1.xlsx to new excel file (new.xlsx), everything works perfect, data from new.xlsx is being put to new.json file correctly. What options of xlsx file are not being set while msexcel-builder creates it? And is there any solution to fix this?