receipt-scanner icon indicating copy to clipboard operation
receipt-scanner copied to clipboard

Error while installing in linux

Open dragneelfps opened this issue 6 years ago • 5 comments

This is the log: https://pastebin.com/nUiJgegZ

dragneelfps avatar Dec 07 '18 19:12 dragneelfps

Do you have OpenCV installed?

Schultzer avatar Dec 07 '18 20:12 Schultzer

Yes

dragneelfps avatar Dec 09 '18 19:12 dragneelfps

@dragneelfps I am also in the process of installing receipt-scanner and ran into a similar issue, turns out the git clone i did installed opencv 4, i manually downloaded 3.4.4 from github and extracted/installed that.

When running npm install git+https://[email protected]/danschultzer/receipt-scanner.git -g i still got an error, turns out that it wants to compile, and i was trying to use root, NPM blocked this directly, i haven't tried as a normal user as this is for a docker instance for testing (so i'm not too worried) but i added --unsafe-perm to the end of the npm install command and was able to get it to at least compile/install.

I haven't finished my tinkering on this, noce i do i'll follow up with more information.

Destreyf avatar Dec 17 '18 13:12 Destreyf

@dragneelfps I installed on Debian 9, another issue i ran into is the default directory for opencv's libs is apparently /usr/local/lib/ and the process couldn't find them until i copied the libraries into /usr/lib I don't think this is the best practice, however i'm working through this as a proof of concept ATM.

After moving the libraries into the correct position, i ran into another issue, i'm wondering if Node 11 isn't supported by the progress bar library as it throws an error saying the following:

/usr/lib/node_modules/receipt-scanner/node_modules/progress/lib/node-progress.js:234
    this.stream.write('\n');
                ^

TypeError: this.stream.write is not a function
    at ProgressBar.terminate (/usr/lib/node_modules/receipt-scanner/node_modules/progress/lib/node-progress.js:234:17)
    ... (omitted for brevity)
    at updateProgressBar (/usr/lib/node_modules/receipt-scanner/cli.js:74:9)

At this point just to have this run as a working POC i edited /usr/lib/node_modules/receipt-scanner/cli.js and commented out the "updateProgressBar" function so that it wouldn't try to update it.

  function updateProgressBar () {
    /*bar.update(percentages.reduce(function (a, b) {
      return a + b
    }, 0) / files.length)*/
  }

However i believe this has created an issue where the function never finishes running so now i am going to troubleshoot this further, it seems that "progress" is being tracked even when the progress flag is not set.

Destreyf avatar Dec 17 '18 14:12 Destreyf

@Destreyf Thank you for your investigation.

Schultzer avatar Dec 21 '18 01:12 Schultzer