opvious / highs.ts

Node.js bindings for the HiGHS optimization solver
Apache License 2.0
3 stars 0 forks source link

Cannot find package highs-addon/package.json #44

Closed quentinmassias closed 4 months ago

quentinmassias commented 4 months ago

Hello, first, thanks for the library, got nice results from it !

We just met a problem during the installation of highs-solver.

In the highs-solver/lib/index.js, there is an import of highs-addon but this is error is thrown :

Cannot find package '/usr/app/node_modules/highs-addon/package.json

While digging into the problem, I saw that in your highs-addon/package.json, you have "main": "index.cjs". I can see that file on the GitHub repository, but it does not appear in the highs-addon node_modules files (installed as dependency of highs-solver).

If I copy the content of the index.cjs file of GitHub and create it by myself, the problem is gone.

The thing is, why the index.cjs file is not present in the node_modules/highs-addon files at install ?

I tried to play with CommonJS / ESM configuration of my own package.json / tsconfig.json thinking it could be the problem (because cjs file is CommonJS), ended up by using "type": "module" and "module": "esnext". I don't know if this information is useful.

Thanks in advance for your help !

mtth commented 4 months ago

Hi @quentinmassias. Could you try again after upgrading to 0.6.1? (Tentative fix: https://github.com/opvious/highs.ts/pull/45.)

quentinmassias commented 4 months ago

Hi @mtth, it seems good now, thanks !