How to run electron as root - ionic-framework

I try to run electron on may kali linux as where I am the root but it doesn't show anything but it works on my ubuntu where I am not the root.
When I run: npm run electron:start
I get this:
11640:0227/233443.028885:FATAL:atom_main_delegate.cc(211)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
help me please.

The only solution I found is to do it without being root. And until then for it to work when you execute the command "
npx cap open electron
", you must locate the directory of the chrome-sandbox file in the error message where you will have to execute the following two commands:
sudo chown root: root chrome-sandbox
sudo chmod 4755 chrome-sandbox
Generally, here is what I do to use ionic and electron on Kali linux:
1. npm install ngx-electron electron
2. npm install electron-packager --save-dev
3. ionic build
4. npx cap add electron
5. ionic build && npx cap copy
6. npx cap open electron
You can see here for more explanation:
https://gist.github.com/gnopor/d4813628c949294c4ef8b4ef88941f68

Related

I need help to build ionic with iOS i have this problem :

ionic cordova build ios
ng run app:ionic-cordova-build --platform=ios
Error: Unknown argument: platform
[ERROR] An error occurred while running subprocess ng.
ng run app:ionic-cordova-build --platform=ios exited with exit code 1.
Re-running this command with the --verbose flag may provide more
information.
It looks like you're running into permission issues. If you are installing npm-packages then it might possible that you are getting an EACCES error when trying to install a package globally. This means you do not have permission to write to the directories npm uses to store global packages and commands.
Try running commands:
sudo chmod u+x -R 775 ~/.npm
sudo chown $USER -R ~/.npm
or you can just run any npm command with sudo, that should get resolve your issue.
sudo ionic cordova build ios
I'd recommend you to take a look at https://docs.npmjs.com/getting-started/fixing-npm-permissions

ionic can't serve project (exit code 13)

I'm a beginner of ionic. I download repo and couldn't start it.(I try npm install) I getting an exit code 13. How can I solve this problem.
try command
npm install #ionic/app-scripts#latest --save-dev
and update python to the latest version 3.9.4
Add a new script inside your package.json as lets say
"start": "ionic serve --port=8080"
Then run npm run start from the command line/terminal
what do you get?

error in react-native run-android

I am trying to run my app on the emulator
But where it's going to hang
And others do not
What is the problem?
http://uupload.ir/files/w7jt_hang.png
And after a few minutes this happens
http://uupload.ir/files/x5pw_v.jpg
Try running this command to re-install your packages and clean your cache watchman watch-del-all && rm -rf $TMPDIR/react-* && rm -rf node_modules/ && npm cache verify && npm install && npm start -- --reset-cache
It could take a couple minutes to run so be patient with it.
This can be achieved by two ways as follows:
1] Please remove node_modules folder of your project and afterward you need to bypass all permission related issues by changing the prefix for npm. Please use below command to bypass all permissions:
npm config set unsafe-perm true
Then use below commands:
npm install
npm start -- --reset-cache
2] You need to run your command prompt(cmd.exe) as administrator.(right click to
command prompt and run as administrator)
Then use below commands:
npm install

ionic is not recognized as an internal or external command operable program or batch file

I have tried to install ionic framework. I was done with my first step by executing the command (installed node.js).
First command: npm install -g cordova ionic
But the second command is not executing instead stating"ionic is not recognized as an internal or external command operable program or batch file "
Second command:ionic start myApp tabs
I request to help me out
I'm using windows 10 for developing, I solved it by adding the npm global packages folder:
%USERPROFILE%\AppData\Roaming\npm
to the environment variable Path
I assume you are trying to install ionic in windows.
I think you could try to install it alone, without cordova, and then try it again.
npm install -g ionic
Regards
İf "ionic" is installed;
1-Download and upgrade nodejs to latest version.
download nodejs
2- run command:
npm uninstall -g ionic
3-Clear these files:
C:\Users\user\AppData\Roaming\npm
C:\Users\user\AppData\Roaming\npm-cache
3-run command:
npm install -g #ionic/cli
İt is done:)
SET PATH=C:\Program Files\Nodejs;%PATH%
Is worked for me on Windows 10 :)

Install ionic framework.

I have installed the module with node version v0.10.22
sudo npm install -g ionic
But know when I am trying to start an new application I am getting a
-bash command not found
which ionic
gives me nothing, do I have to add the path to on the $PATH variable ?
How did you installed npm? If you used homebrew then npm won't put npm files accessible by users.
Add export PATH=/usr/local/share/npm/bin:$PATH to your .bashrc/.bash_profile/.zshrc file and it should work fine.
Also refer this: Bower: "command not found" after installation