harshankur / officeParser

A Node.js library to parse text out of any office file. Currently supports docx, pptx, xlsx and odt, odp, ods..
MIT License
150 stars 20 forks source link

Errors in windows xp, in linux and in termux android #1

Closed Daniil-Sokolov closed 1 year ago

Daniil-Sokolov commented 4 years ago

Hello I'm trying creat with this module NW.JS and Android-js apps And i found one interesting error This module cannot work with xlsx files in windows xp And cannot work with ods files in linux and termux

Thank you for your attention

Console massage:

(node:16321) UnhandledPromiseRejectionWarning: Error: EISDIR: illegal operation on a directory, open 'officeDist/Configurations2/statusbar/'                            (node:16321) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)                                (node:16321) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.                    $ node pars.js                                          (node:16375) UnhandledPromiseRejectionWarning: Error: EISDIR: illegal operation on a directory, open 'officeDist/Configurations2/toolpanel/'
(node:16375) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:16375) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
harshankur commented 4 years ago

Well, I can imagine the errors in Windows XP as NodeJS dropped support for it 4-5 years ago. And regarding "linux and termux" too, I guess you need to provide more info regarding the npm version you are using. It doesn't depend so much on OS in my opinion.

By the way, I have setup a Windows XP environment on VirtualBox for this purpose now. Let me know your nodejs version on XP too.

Daniil-Sokolov commented 4 years ago

in windows 10 all functions is working: node -v v10.16.0 npm -v 6.9.0

in termux don't work ods: node -v v12.12.0 npm -v 6.13.7

in linux don't work ods: some of node -v v12.x and npm -v 6.x

in windows xp don't work xlsx: some of node -v v5.x and v4.x, and npm -v 2.x

and i found another your module "anyparser", and this module have same errors, unfortunately

Thank you for your attention

but for parsing office in windows 10 now this 2 modules is must have modules

Daniil-Sokolov commented 4 years ago

This error is decompress module error

Daniil-Sokolov commented 4 years ago

Hello! I think i won this problem i have changed decompress module to adm-zip module for extraction office files and this resolution was very simple first step: npm install adm-zip second step is changing requirements: from const decompress = require('decompress'); to const AdmZip = require('adm-zip');

and third step is adding new promise in officeParser module:

var decompressLocation = "officeDist";
function decompress(filename, decompressLocation) {
  return new Promise((resolve, reject) => {
    var zip = new AdmZip(filename);
    if (filename != undefined) {
      resolve(zip.extractAllTo(decompressLocation, /*overwrite*/true))
    } else {
      reject("Ошибка")
    }
  })
};

This is all what i did, and now it works in linux and in termux, it should be working in windows 10 i think But unfortunately i think it will not work in windows xp, because node 5.x and npm 2.x not working with async/await, but i will test it Thank you for attention and your work This module is cool

harshankur commented 4 years ago

Wow, I will check it out. If there is an unmaintained dependency issue, I will fix it right away. But overall, I think I need to give it a look to improve the codebase too.

Thank You for your input. :)

harshankur commented 1 year ago

Issue arising from problems with decompress module. Will be fixed along with issue #2.

Marked as duplicate