node-gtk: Cannot resolve typelib (Granite)
Tried to import granite lib on elementary os.
** (process:12176): WARNING **: 14:18:27.911: Failed to load shared library '/build/granite-yhN8Lb/granite-5.2.3+r1346+pkg106~daily~ubuntu5.0.1/obj-x86_64-linux-gnu/lib/libgranite.so.5.2.2' referenced by the typelib: /build/granite-yhN8Lb/granite-5.2.3+r1346+pkg106~daily~ubuntu5.0.1/obj-x86_64-linux-gnu/lib/libgranite.so.5.2.2: cannot open shared object file: No such file or directory
**
ERROR:../src/gobject.cc:349:v8::Local<v8::FunctionTemplate> GNodeJS::NewClassTemplate(GIBaseInfo*, GType): assertion failed: (gtype != G_TYPE_NONE)
[1] 12176 abort node index.js
const Granite = gi.require("Granite");
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 27 (16 by maintainers)
@harisvsulaiman GNOME on ArchLinux here if needed 👋
@WebReflection on linux - elementary 😃.
@harisvsulaiman … about this
you should probably try gjs instead, which is closer, even if based on SpiderMonkey, to what it’s done here.
The ideal env for GJS is Linux, but
brew install gjsshould work too (it’s quartz based so some dependency doesn’t work there but usually most of the things are fine).If on Mac and you don’t fancy Home Brew, try MacPorts.
If on Windows, you have this post covering WSL 👋
Ok, I’m not sure what’s the issue here, and I unfortunately don’t have enough time to debug it in details for the moment.
One thing you could do is try to import Granite in a different gobject-introspection runtime (such as PyGObject) to validate that it’s a bug in node-gtk and it’s not caused by the Granite bindings.