question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Setcap not working with Electron - need to use sudo

See original GitHub issue

Hi, I’m using bleno in an electron app and have followed all the steps for installation.

I launch my application using electron main.js

As such I have run this step:

sudo setcap cap_net_raw+eip $(eval readlink -f `which electron`)

However I still get the error suggesting I run it with sudo. It works fine when I run it with sudo but it messes with other things in my application. I’ve applied the above step to both electron and node both which are on my path. Any ideas?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
elovincommented, Nov 2, 2017

It’s correct that you need to set the permissions on the electron executable, but this is probably the local electron executable since this is the one you will package and ship. Also you need to add the packaged libnode.so to the dynamic linker in linux because the node version might differ from system to system or might not be installed at all.

This is what I did: sudo setcap cap_net_raw+eip ./node_modules/electron/dist/electron and than adding the absolute path to the dist directory to a new config file “electron-node.conf” in /etc/ld.so.conf.d/ after that I reloaded the linker with sudo ldconfig.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Where is the local node.js from the electron framework located?
Since this isn't a good solution for production use, I tried the official command sudo setcap cap_net_raw+eip $(eval readlink -fwhich node) but ...
Read more >
Run Electron without GUI - Stack Overflow
I have an Electron based Web Server. It's meant for beginning web developers, students, and artists that are not used to the command...
Read more >
setcap not working with Proton : r/SteamPlay - Reddit
I'm trying to run Battlefield 4 with proton but I have the no ping bug. Basically, the game doesn't detect my ping and...
Read more >
Controlling smart devices via BLE. Electron and React Native.
Using regular Bluetooth was not an option, because we don't need to ... To work with the native modules in the renderer, the...
Read more >
Tor - ArchWiki - Arch Linux
If your computer is not running a web server, and you have not set ... so to use those, Tor must be run...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found