Manetos / node-fuzzylite

A Node.js interface for the fuzzylite library
Apache License 2.0
1 stars 0 forks source link

Cannot run library in a windows environment #4

Open vchibilisco opened 6 years ago

vchibilisco commented 6 years ago

Hello, when I try to run my rules I have this error

error: Error: Command failed: echo 0.1 0.2 q | LD_LIBRARY_PATH="X:\Proyectos\Sovos\Innovation Challenge\sovos-community-be\node_modules\fuzzylite\fuzzylite\fuzzylite\release\bin" X:\Proyectos\Sovos\Innovation Challenge\sovos-community-be\node_modules\fuzzylite\fuzzylite\fuzzylite\release\bin\fuzzylite -i "get_seniority.fcl" -of fld
"LD_LIBRARY_PATH" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

My code is this:

const fuzzylite = new Fuzzylite('get_seniority.fcl');
  const ambience = 0.1;
  const cost = 0.2;
  fuzzylite.runController([ambience, cost], (error, output) => {
    if(error) {
        return console.log('error: ' + error);
    }
    console.log('output is: ' + output);
  });

Can you help me?

ecksun commented 6 years ago

Could you provide the error message in english?

My very first guess would be that windows (which I assume you arerunning considering the paths you pasted in the issue) doesn't support the environment variable LD_LIBRARY_PATH.

LD_LIBRARY_PATH is used to try to load the bundled if ordinary (that is, using a natively installed fuzzylite binary) execution fails.

So a possible solution is to install fuzzylite yourself and not rely on any binary bundled in this package.

Keep in mind though, this library, afaik, is entierly untested on windows and might not work at all.

I'm open to accepting both patches that fixes that or updates the README to document the current behaviour.

vchibilisco commented 6 years ago

@ecksun sorry my delay. Yes, basically, windows does not recognize the LD_LIBRARY_PATH variable. I could not work with this library and I found other solution in java. But I will try install fuzzylite, like you mention. Thanks

ecksun commented 6 years ago

No worries.

In that case I will update this issue as to reflect that this is an issue with the library running on windows and leave it open for potential future fixes :)