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: libuuid.so.1: cannot open shared object file: No such file or directory #1893

Closed
demirdegerli opened this issue Sep 4, 2021 · 16 comments

Comments

@demirdegerli
Copy link

demirdegerli commented Sep 4, 2021

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/demir09/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)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object.<anonymous> (/home/runner/demir09/node_modules/canvas/lib/canvas.js:9: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) {
  code: 'ERR_DLOPEN_FAILED'
}

Environment

+-- canvacord@5.2.3
| +-- canvas@2.8.0 deduped
| `-- gifencoder@2.0.1
|   `-- canvas@2.8.0 deduped
+-- canvas@2.8.0
`-- text2png@2.3.0
  `-- canvas@2.8.0 deduped
  • Node version: v16.7.0
@demirdegerli
Copy link
Author

demirdegerli commented Sep 7, 2021

solved

[EDIT] same solution i used before:
@C00LVansh's solution

@torresLuis16
Copy link

what is the solution?

@samirop12
Copy link

whats the solution

@rofrol
Copy link

rofrol commented Dec 1, 2021

libuuid needs to be available in LD_LIBRARY_PATH.

Probably you need to install some package https://stackoverflow.com/questions/23579681/error-in-rstudio-libuuid-so-1-cannot-open-shared-object-file-no-such-file-or

For nixos this is solution https://discourse.nixos.org/t/node2nix-issues/10762/2

@Edemarz
Copy link

Edemarz commented Dec 20, 2021

I'm getting the same error on Repl Node.JS Version 16 using Linux. And none of the solutions worked for me

@KimmyKx
Copy link

KimmyKx commented Feb 18, 2022

I was getting the same error, while using node-canvas in repl.it and all you need is to downgrade the node version to 16.10.0 npm install node@16.10.0, works like a charm for me.

@APOORVBG
Copy link

whats solution :(

@C00LVansh
Copy link

C00LVansh commented Apr 12, 2022

@Edemarz @APOORVBG
If you are facing this error at replit
Follow this steps to fix it:

  1. Click on three dots and then click on show hidden files
  2. go to file name 'replit.nix'
  3. now under deps add:
    pkgs.libuuid
  4. now after deps go to a fresh line (make sure there are no syntax conflicts), and paste this:
    env = { LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.libuuid]; };
  5. Tada 🎉 your error is fixed, enjoy and thank me later :)

@dabeast4647
Copy link

I was getting the same error, while using node-canvas in repl.it and I did npm install node@16.10.0, works like a charm for me.
Worked for myself

@FlixzSamurai
Copy link

well it didn't work because i followed the steps and it spammed the same thing over and over and over again

@IdkButHey
Copy link

IdkButHey commented Sep 13, 2022

well it didn't work because i followed the steps and it spammed the same thing over and over and over again

Are you sure you did it correctly? Maybe try rereading the steps and following the exact order.

@josephrocca
Copy link

In case other's make the same mistake I did while following C00lVansh's instructions: Make sure env is within the {pkgs} block rather than outside it, like this:

{ pkgs }: {
  deps = [
    pkgs.nodejs-18_x
    pkgs.nodePackages.typescript-language-server
    pkgs.yarn
    pkgs.replitPackages.jest
    pkgs.libuuid
  ];
  env = { LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.libuuid];  }; 
}

@VisoredPrograms
Copy link

Where is this file?? I don't see it

@felipelalli
Copy link

None of the tips above worked for me in NixOS, so I found my own solution:

Edit /etc/nixos/configuration.nix as sudo and make these changes:


{ config, lib, pkgs, modulesPath, ... }:

let
  mainUser = "myuser";
  homeDirectory = config.users.users.${mainUser}.home;
in
{
  # (...)

  # List packages installed in system profile. To search, run:
  # $ nix search wget
  environment.systemPackages = with pkgs; [
    libuuid
  ];

  environment = {
    sessionVariables = {
      LD_LIBRARY_PATH = "${pkgs.lib.makeLibraryPath [pkgs.libuuid]}";
    };
  };
}

Then:
sudo nixos-rebuild switch

Unfortunately, to take full effect in my env test only after a reboot.

@RashiqAzhan
Copy link

RashiqAzhan commented May 12, 2024

Still broken for me with Nix. I'm using devbox. @demirdegerli @C00LVansh if you have any ideas.

 node:internal/modules/cjs/loader:1473
   return process.dlopen(module, path.toNamespacedPath(filename));
                  ^

 Error: libuuid.so.1: cannot open shared object file: No such file or directory
     at Module._extensions..node (node:internal/modules/cjs/loader:1473:18)
     at Module.load (node:internal/modules/cjs/loader:1207:32)
     at Module._load (node:internal/modules/cjs/loader:1023:12)
     at require (node:internal/modules/esm/translators:248:28)
     at Object.<anonymous> (.../node_modules/canvas/lib/bindings.js:3:18)
     at loadCJSModule (node:internal/modules/esm/translators:270:3)
     at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:305:7)
     at ModuleJob.runSync (node:internal/modules/esm/module_job:209:17)
     at require (node:internal/modules/esm/translators:255:9)
     at Object.<anonymous> (.../node_modules/canvas/lib/canvas.js:9:18) {
   code: 'ERR_DLOPEN_FAILED'
 }

devbox.json

{
  "$schema": "https://raw.githubusercontent.com/jetpack-io/devbox/0.10.1/.schema/devbox.schema.json",
  "packages": [
    "nodejs-slim@20.11.1",
    "libuuid@latest"
  ],
  "env": {
    "LD_LIBRARY_PATH": "pkgs.lib.makeLibraryPath [pkgs.libuuid]"
  },
  "shell": {
    "init_hook": ["echo 'Welcome to devbox!' > /dev/null"],
    "scripts": {
      "test": ["echo \"Error: no test specified\" && exit 1"]
    }
  }
}

@Maryam-Rajput
Copy link

@Edemarz @APOORVBG If you are facing this error at replit Follow this steps to fix it:

  1. Click on three dots and then click on show hidden files
  2. go to file name 'replit.nix'
  3. now under deps add:
    pkgs.libuuid
  4. now after deps go to a fresh line (make sure there are no syntax conflicts), and paste this:
    env = { LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.libuuid]; };
  5. Tada 🎉 your error is fixed, enjoy and thank me later :)

Thankuuuuuuuuuuuuu very much for your solution i v been facing this from too many days thanks u fixed it ❤❤

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

No branches or pull requests