Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: faiss-node package.json is not node-pre-gyp ready #38

Open
andreia-oca opened this issue Sep 1, 2023 · 1 comment
Open

Error: faiss-node package.json is not node-pre-gyp ready #38

andreia-oca opened this issue Sep 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@andreia-oca
Copy link

Describe the bug
I cannot install faiss-node using node-pre-gyp.

I am receiving the following error:

stdout: '',
  stderr: 'node-pre-gyp ERR! UNCAUGHT EXCEPTION \n' +
    'node-pre-gyp ERR! stack Error: faiss-node package.json is not node-pre-gyp ready:\n' +
    'node-pre-gyp ERR! stack package.json must declare these properties: \n' +
    'node-pre-gyp ERR! stack binary.module_name\n' +
    'node-pre-gyp ERR! stack binary.module_path\n' +
    'node-pre-gyp ERR! stack binary.host\n' +
    'node-pre-gyp ERR! stack     at validate_config (/tmp/genezio-25053/3577lj/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js:220:11)\n' +
    'node-pre-gyp ERR! stack     at module.exports.evaluate (/tmp/genezio-25053/3577lj/node_modules/@mapbox/node-pre-gyp/lib/util/versioning.js:279:3)\n' +
    'node-pre-gyp ERR! stack     at clean (/tmp/genezio-25053/3577lj/node_modules/@mapbox/node-pre-gyp/lib/clean.js:16:27)\n' +
    'node-pre-gyp ERR! stack     at self.commands.<computed> [as clean] (/tmp/genezio-25053/3577lj/node_modules/@mapbox/node-pre-gyp/lib/node-pre-gyp.js:86:37)\n' +
    'node-pre-gyp ERR! stack     at run (/tmp/genezio-25053/3577lj/node_modules/@mapbox/node-pre-gyp/lib/main.js:81:30)\n' +
    'node-pre-gyp ERR! stack     at Object.<anonymous> (/tmp/genezio-25053/3577lj/node_modules/@mapbox/node-pre-gyp/lib/main.js:125:1)\n' +
    'node-pre-gyp ERR! stack     at Module._compile (node:internal/modules/cjs/loader:1256:14)\n' +
    'node-pre-gyp ERR! stack     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10)\n' +
    'node-pre-gyp ERR! stack     at Module.load (node:internal/modules/cjs/loader:1119:32)\n' +
    'node-pre-gyp ERR! stack     at Module._load (node:internal/modules/cjs/loader:960:12)\n' +
    'node-pre-gyp ERR! System Linux 5.15.0-82-generic\n'

Environment:

  • Operating system: [Ubuntu x64]
  • Nodejs Version: [v18.17.1]
  • Package Version: [0.3.0]

To Reproduce
Steps to reproduce the behavior:

  1. Install faiss-node and go to node_modules/faiss-node.
  2. Run the following command in node_modules/faiss-node
npx node-pre-gyp --update-binary --fallback-to-build --target_arch=arm64 --target_platform=linux --target_libc=glibc clean install faiss--node

You should receive the same error as I did.

Expected behavior

The following command should be successful:

npx node-pre-gyp --update-binary --fallback-to-build --target_arch=arm64 --target_platform=linux --target_libc=glibc clean install faiss--node

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

** Possible Solution**

In the package.json the binary section is not complete, hence node-pre-gyp doesn't know how to fetch the binary.

I tested, and this snippet of code does the trick (although it's incomplete because I hardcoded the napi-version to v8):

"binary": {
    "module_name": "faiss-node",
    "module_path": "./build/Release/faiss-node.node",
    "package_name": "faiss-node-v{version}-napi-v8-{platform}-{arch}.tar.gz",
    "host": "https://github.com/",
    "remote_path": "ewfian/faiss-node/releases/download/v{version}"
  },

Can you maybe fix this or can I propose a PR?

@andreia-oca andreia-oca added the bug Something isn't working label Sep 1, 2023
@ewfian
Copy link
Owner

ewfian commented Sep 4, 2023

@andreia-oca PRs are welcome,Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants