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.