Skip to content
This repository has been archived by the owner on Sep 12, 2023. It is now read-only.

Unable to run in Node #18

Open
jamespantalones opened this issue May 19, 2022 · 3 comments
Open

Unable to run in Node #18

jamespantalones opened this issue May 19, 2022 · 3 comments

Comments

@jamespantalones
Copy link

I am running in an Ubuntu container after following the instructions listed on the repo here (and the wasmedge-quickjs repo).

I am instantiating the VM like so:


const path = require("path");
const wasmedge = require("wasmedge-core");

const vm = new wasmedge.VM(
  path.resolve(process.cwd(), "target/wasm32-wasi/release/main.wasm"),
  {
    EnableWasiStartFunction: true,
    args: [],
    preopens: {},
  }
);

console.log(vm);

vm.Start();

However, whenever i try to start the app, I am receiving the following error:

root@944558b7af10:/app# node server
/app/node_modules/wasmedge-core/index.js:7
process.dlopen(module, binding_path,
        ^
Error: /app/node_modules/wasmedge-core/lib/binding/linux-x64/wasmedge.node: cannot open shared object file: No such file or directory
    at Object.<anonymous> (/app/node_modules/wasmedge-core/index.js:7:9)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Module._load (node:internal/modules/cjs/loader:827:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at Object.<anonymous> (/app/server.js:4:18)
    at Module._compile (node:internal/modules/cjs/loader:1105:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1159:10) {
  code: 'ERR_DLOPEN_FAILED'
}

Any ideas on what this could be? Thanks

@hydai
Copy link
Member

hydai commented May 20, 2022

Do you have full logs including how to install the wasmedge-core part? I am not sure if the wasmedge-core is built or installed successfully.

@proohit
Copy link

proohit commented Jan 25, 2023

I'm having similar problems there.

Error: libwasmedge_c.so: cannot open shared object file: No such file or directory
    at Object.<anonymous> (/home/direnc/workspace/custom-framework/examples/node/node_modules/wasmedge-core/index.js:7:9)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10)
    at Module.load (node:internal/modules/cjs/loader:1037:32)
    at Module._load (node:internal/modules/cjs/loader:878:12)
    at Module.require (node:internal/modules/cjs/loader:1061:19)
    at require (node:internal/modules/cjs/helpers:103:18)
    at Object.<anonymous> (/home/direnc/workspace/custom-framework/examples/node/lib.js:3:18)
    at Module._compile (node:internal/modules/cjs/loader:1159:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1213:10) {
  code: 'ERR_DLOPEN_FAILED'
}

For some reason, libwasmedge_c.so isn't installed when installing WasmEdge. The Go bindings work without problems. My $HOME/.wasmedge/lib lists following files and there is no libwasmedge_c.so:

$ ls ~/.wasmedge/lib
libtensorflow.so        libtensorflow_framework.so        libtensorflowlite_c.so           libwasmedge.so
libtensorflow.so.2      libtensorflow_framework.so.2      libwasmedge-image_c.so           libwasmedge.so.0
libtensorflow.so.2.6    libtensorflow_framework.so.2.6    libwasmedge-tensorflow_c.so      libwasmedge.so.0.0.1
libtensorflow.so.2.6.0  libtensorflow_framework.so.2.6.0  libwasmedge-tensorflowlite_c.so

@hydai
Copy link
Member

hydai commented Jan 29, 2023

Hi @proohit
The libwasmedge_c is renamed to libwasmedge after the 0.10.0 release. That's why the dlopen failed. It's not a trivial fix, since there are several API changes between 0.9.0 and the latest one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants