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

electron: error while loading shared libraries: libffmpeg.so: cannot open shared object file: No such file or directory #25440

Closed
2 of 3 tasks
juniormayhe opened this issue Sep 12, 2020 · 7 comments
Labels

Comments

@juniormayhe
Copy link

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version:
    Cannot run node_modules/.bin/electron --version: error while loading shared libraries: libffmpeg.so: cannot open shared object
    the version defined in package.json devDependencies is "electron": "^10.1.1"
  • Operating System:
    • Ubuntu 20.04 x64 on Windows 10.0.18363.1016
  • Last Known Working Electron version:
    None

Expected Behavior

Start the electron application

Actual Behavior

Cannot start electron app in Ubuntu WSL

To Reproduce

Within app folder search libffmpeg.so:

$ find . -name libffmpeg.so
./node_modules/electron/dist/libffmpeg.so

Start your app

/home/username/yourapp/node_modules/electron/dist/electron: error while loading shared libraries: libffmpeg.so: cannot open shared object file: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! yourapp@1.0.0 start: `electron .`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the yourapp@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
@LebedevGor
Copy link

Same problem with Ubuntu Server 20.04 . Electron version: 7.1.3.
The same packaged application works fine on Ubuntu Server 18.04.

@chkaos

This comment has been minimized.

@karmelyoei

This comment has been minimized.

@Prinzhorn
Copy link
Contributor

Prinzhorn commented Mar 19, 2021

I'm currently running into this on Ubuntu 20.04 (regular plain Ubuntu, no WSL) using Electron Fiddle:

/home/alex/.config/Electron Fiddle/electron-bin/13.0.0-beta.2/electron: error while loading shared libraries: libffmpeg.so: cannot open shared object file: No such file or directory

Electron exited with code 127.

Curiously this doesn't happen with all versions, I hope this helps tracking this down:

v13.0.0-beta.2 crashes
v13.0.0-beta.3 works
v13.0.0-beta.4 works
v13.0.0-beta.5 crashes
v13.0.0-beta.6 works
v13.0.0-beta.7 works

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2022

This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

@github-actions github-actions bot added the stale label Oct 7, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Nov 6, 2022

This issue has been closed due to inactivity, and will not be monitored. If this is a bug and you can reproduce this issue on a supported version of Electron please open a new issue and include instructions for reproducing the issue.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 6, 2022
@SiegeSailor
Copy link

SiegeSailor commented Jul 12, 2023

I am facing the exactly same issue with electron-forge. I built my project from the Electron-Forge-Webpack-TypeScript template. My package.json:

I opened an issue for Forge as well: electron/forge#3274

"dependencies": {
    "electron-squirrel-startup": "1.0.0"
  },
  "devDependencies": {
    "@electron-forge/cli": "6.2.1",
    "@electron-forge/maker-deb": "6.2.1",
    "@electron-forge/maker-rpm": "6.2.1",
    "@electron-forge/maker-squirrel": "6.2.1",
    "@electron-forge/maker-zip": "6.2.1",
    "@electron-forge/plugin-auto-unpack-natives": "6.2.1",
    "@electron-forge/plugin-webpack": "6.2.1",
    "@types/jest": "29.5.3",
    "@types/node": "20.4.1",
    "@typescript-eslint/eslint-plugin": "5.62.0",
    "@typescript-eslint/parser": "5.62.0",
    "@vercel/webpack-asset-relocator-loader": "1.7.3",
    "css-loader": "6.8.1",
    "dotenv": "16.3.1",
    "electron": "25.2.0",
    "electron-store": "8.1.0",
    "fork-ts-checker-webpack-plugin": "7.3.0",
    "husky": "8.0.3",
    "jest": "29.6.1",
    "jest-environment-node": "29.6.1",
    "jest-junit": "16.0.0",
    "lint-staged": "13.2.3",
    "node-loader": "2.0.0",
    "prettier": "3.0.0",
    "style-loader": "3.3.3",
    "ts-jest": "29.1.1",
    "ts-loader": "9.4.4",
    "ts-node": "10.9.1",
    "typescript": "5.1.6"
  },

Reproduce

I am running the following on Windows WSL with Ubuntu 22.04.2, Node 18.16.1, and NPM 9.5.1:

npm install

# Install packages for X Server
apt update
apt install libgconf-2-4 libatk1.0-0 libatk-bridge2.0-0 \
libgdk-pixbuf2.0-0  libgtk-3-0 libgbm-dev libnss3-dev libxss-dev libasound2 \
x11-xserver-utils

# Setup bus
export DISPLAY=$(grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'):0.0
xhost +
service dbus start
export XDG_RUNTIME_DIR=/run/user/$(id -u)
if [ -d "$XDG_RUNTIME_DIR" ]; then
    echo "$XDG_RUNTIME_DIR already exists."
else
    mkdir $XDG_RUNTIME_DIR
fi
chmod 700 $XDG_RUNTIME_DIR
chown $(id -un):$(id -gn) -R $XDG_RUNTIME_DIR
export DBUS_SESSION_BUS_ADDRESS=unix:path=$XDG_RUNTIME_DIR/bus
dbus-daemon --session --address=$DBUS_SESSION_BUS_ADDRESS --nofork --nopidfile --syslog-only &

# Have VcsXsrv, a WSL X Server, running

apt install rpm --yes
npm run package
# Switch to a non-root user to avoid getting Running as root without -no-sandbox is not supported error
chmod -R 777 ./out/
sudo adduser guest
su guest
./out/window-linux-x64/window

Then I get ./out/window-linux-x64/window: error while loading shared libraries: libffmpeg.so: cannot open shared object file: No such file or directory error.

I have tried to install the following:

apt install chromium-codecs-ffmpeg ffmpeg

But no luck. I get usr/bin/ffmpeg when I run which ffmpeg, and I am sure libffmpeg.so is under my bundled app folder. The following is what I get when I run ls -al ./out/window-linux-x64:

drwxrwxrwx 4 root root      4096 Jul 12 10:37 .
drwxrwxrwx 4 root root      4096 Jul 12 10:37 ..
-rwxrwxrwx 1 root root      1096 Jul 12 10:37 LICENSE
-rwxrwxrwx 1 root root   8247912 Jul 12 10:37 LICENSES.chromium.html
-rwxrwxrwx 1 root root     53840 Jul 12 10:37 chrome-sandbox
-rwxrwxrwx 1 root root    136579 Jul 12 10:37 chrome_100_percent.pak
-rwxrwxrwx 1 root root    197691 Jul 12 10:37 chrome_200_percent.pak
-rwxrwxrwx 1 root root   1246464 Jul 12 10:37 chrome_crashpad_handler
-rwxrwxrwx 1 root root  10544880 Jul 12 10:37 icudtl.dat
-rwxrwxrwx 1 root root    251064 Jul 12 10:37 libEGL.so
-rwxrwxrwx 1 root root   6435400 Jul 12 10:37 libGLESv2.so
-rwxrwxrwx 1 root root   2877488 Jul 12 10:37 libffmpeg.so
-rwxrwxrwx 1 root root   4565640 Jul 12 10:37 libvk_swiftshader.so
-rwxrwxrwx 1 root root   6396248 Jul 12 10:37 libvulkan.so.1
drwxrwxrwx 2 root root      4096 Jul 12 10:37 locales
drwxrwxrwx 2 root root      4096 Jul 12 10:37 resources
-rwxrwxrwx 1 root root   5214565 Jul 12 10:37 resources.pak
-rwxrwxrwx 1 root root    259202 Jul 12 10:37 snapshot_blob.bin
-rwxrwxrwx 1 root root    578034 Jul 12 10:37 v8_context_snapshot.bin
-rwxrwxrwx 1 root root         6 Jul 12 10:37 version
-rwxrwxrwx 1 root root       107 Jul 12 10:37 vk_swiftshader_icd.json
-rwxrwxrwx 1 root root 166316624 Jul 12 10:37 window

window is the executable. I define the name in forge.config.ts.

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

No branches or pull requests

6 participants