Skip to content
Sign upLog in
This post is read-only. Explore Repls and connect with other creators on Community.View Community
The info in this post might be out of date, check out our docs instead. View docs
5

Discord.js Canvas error: libuuid.so.1: cannot open shared object file: No such file or directory

ASOwnerYT
ASOwnerYT

Hello,
I'm trying to use the npm package Canvas with my Discord bot (Node.js 16 running with Nix on my Replit), and when I run my bot I get the following error:

node:internal/modules/cjs/loader:1183 return process.dlopen(module, path.toNamespacedPath(filename)); ^ Error: libuuid.so.1: cannot open shared object file: No such file or directory at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) at Module.require (node:internal/modules/cjs/loader:1005:19) at require (node:internal/modules/cjs/helpers:94:18) at Object.<anonymous> (/home/runner/asowneryt-discord-bot/node_modules/canvas/lib/bindings.js:3:18) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12) { code: 'ERR_DLOPEN_FAILED' } exit status 1

I install Canvas by running this command in the shell: npm install canvas

1 year ago
You are viewing a single comment. View All
4
yofiss
yofiss

@NinjaCoderTech

{ pkgs }: {
deps = [
pkgs.nodejs-16_x
pkgs.libuuid
];
env = {
LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.libuuid];
};
}

This in the replit.nix fixed it for me.

10 months ago