1

I'm trying to run my electron app using sudo privilege, but i keep getting this error.

sudo yarn start => [22144:0610/115332.565394:FATAL:electron_main_delegate.cc(211)] Running as root without --no-sandbox is not supported.

Here is my script:

    "scripts": {
        "prod": "cross-env NODE_ENV=production webpack --mode production --config webpack.build.config.js && electron --noDevServer .",
        "start": "cross-env ELECTRON_ENABLE_LOGGING=true NODE_ENV=development webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js --mode development",
        "build": "cross-env NODE_ENV=production webpack --config webpack.build.config.js --mode production",
        "package": "npm run build",
        "postpackage": "electron-packager ./ --out=./builds"
      },

I wonder how to add --no-sandbox flag.

I'll be grateful for your help.

Amir Zare
  • 41
  • 5
  • doesnt this work? "start": "cross-env ELECTRON_ENABLE_LOGGING=true NODE_ENV=development webpack-dev-server --hot --host 0.0.0.0 --config=./webpack.dev.config.js --mode development --no-sandbox" – qristjan Jun 10 '20 at 07:49
  • No, I 'd added --no-sandbox at that point but nothing happened and still the same error. (I don't know whether this help or not but my os is based on ubuntu) – Amir Zare Jun 11 '20 at 07:08

0 Answers0