koush / electron-chrome

Other
970 stars 68 forks source link

Could someone explain how to use this? (NOOB alert) #51

Open Botspot opened 4 years ago

Botspot commented 4 years ago

I have a Chrome App, Boxy SVG, than I want to convert to an electron app on an armhf Debian machine. (Raspberry Pi)

It's .crx has been extracted, and the containing folder is located at /home/pi/Desktop/3.33.2_0. Inside 3.33.2_0, there are all the App's files, including manifest.json.

From the $HOME folder, I've run these commands:

git clone https://github.com/koush/electron-chrome.git
cd electron-chrome
npm install

This command seemed to exit with errors:

pi@raspberrypi:~/electron-chrome $ sudo npm install -g electron
/usr/bin/electron -> /usr/lib/node_modules/electron/cli.js
npm WARN lifecycle The node binary used for scripts is /usr/local/bin/node but npm is using /usr/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.
[...]
Error: EACCES: permission denied, mkdtemp '/usr/lib/node_modules/electron/electron-download-KQ0oj5'
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! electron@9.0.5 postinstall: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the electron@9.0.5 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2020-07-01T14_40_12_944Z-debug.log

But here's where I'm having trouble:

$ electron --enable-logging . --app-dir=/home/pi/Desktop/3.33.2_0
bash: electron: command not found
Botspot commented 4 years ago

Update: installing the package node using APT seems to have changed things. Now when I run this: pi@raspberrypi:~/electron-chrome $ sudo npm install -g electron That command immediately exits without errors. But electron is still "command not found".

Botspot commented 4 years ago

Update: I tried it on a fresh system, and had to use this command to install electron: sudo npm install -g electron --unsafe-perm=true --allow-root Now I have tried the example:

pi@raspberrypi:~/electron-chrome $ electron --enable-logging . --app-id=gidgenkbbabolejbgbpnhbimgjbffefm
using chrome runtime 1.3.6
chrome app id gidgenkbbabolejbgbpnhbimgjbffefm
chrome app directory /home/pi/.config/ElectronChrome/crx/gidgenkbbabolejbgbpnhbimgjbffefm/app-2.3.0.crx-unpacked
/home/pi/.config/ElectronChrome/crx/gidgenkbbabolejbgbpnhbimgjbffefm/app-2.3.0.crx-unpacked/native/linux/audio_playback.so not found.
/home/pi/electron-chrome/platform-assets/linux/audio_playback.so not found.
PPAPI path /home/pi/.config/ElectronChrome/crx/gidgenkbbabolejbgbpnhbimgjbffefm/app-2.3.0.crx-unpacked/native/linux/video_decode.so;application/x-ppapi-vysor
starting
registerprotocol
starting runtime
[4352:0701/163458.626315:INFO:CONSOLE(1)] "runtime started", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (1)
[4352:0701/163458.676881:INFO:CONSOLE(18)] "appId gidgenkbbabolejbgbpnhbimgjbffefm", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (18)
[4352:0701/163458.711199:INFO:CONSOLE(64)] "launchUrl: null", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (64)
[4352:0701/163458.712062:INFO:CONSOLE(99)] "chrome runtime started", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (99)
[4352:0701/163458.860946:INFO:CONSOLE(24)] "app icon: /home/pi/.config/ElectronChrome/crx/gidgenkbbabolejbgbpnhbimgjbffefm/app-2.3.0.crx-unpacked/icon.png", source: /home/pi/electron-chrome/chrome/api/chrome-app.js (24)
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to retrieve device information
[4352:0701/163459.129514:INFO:CONSOLE(365)] "initialized", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (365)
[4352:0701/163459.144557:INFO:CONSOLE(114)] "creating window __background", source: /home/pi/electron-chrome/chrome/api/chrome-app.js (114)
[4352:0701/163459.360984:INFO:CONSOLE(336)] "opening chrome-extension://gidgenkbbabolejbgbpnhbimgjbffefm/_generated_background_page.html", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (336)
[4352:0701/163459.399475:INFO:CONSOLE(1083)] "%cElectron Deprecation Warning font-weight: bold The 'remote' module is deprecated and will be disabled by default in a future version of Electron. To ensure a smooth upgrade and silence this warning, specify {enableRemoteModule: true} in the WebPreferences for this window.", source: electron/js2c/renderer_init.js (1083)
[4352:0701/163459.403237:INFO:CONSOLE(2601)] "%cElectron Security Warning (Disabled webSecurity) font-weight: bold; This renderer process has "webSecurity" disabled. This
  exposes users of this app to severe security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2601)
[4352:0701/163459.403787:INFO:CONSOLE(2630)] "%cElectron Security Warning (allowRunningInsecureContent) font-weight: bold; This renderer process has "allowRunningInsecureContent"
  enabled. This exposes users of this app to severe security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2630)
[4352:0701/163459.404104:INFO:CONSOLE(2616)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2616)
MESA-LOADER: failed to open kms_swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast (search paths /usr/lib/arm-linux-gnueabihf/dri:\$${ORIGIN}/dri:/usr/lib/dri)
failed to load swrast driver
[4352:0701/163459.928734:INFO:CONSOLE(2438)] "Uncaught (in promise) Error: ERR_BLOCKED_BY_CLIENT (-20) loading 'chrome-extension://gidgenkbbabolejbgbpnhbimgjbffefm/_generated_background_page.html'", source: electron/js2c/renderer_init.js (2438)
[4352:0701/163459.933599:INFO:CONSOLE(317)] "background onload", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (317)
[4352:0701/163459.940725:INFO:CONSOLE(1083)] "%cElectron Deprecation Warning font-weight: bold The 'remote' module is deprecated and will be disabled by default in a future version of Electron. To ensure a smooth upgrade and silence this warning, specify {enableRemoteModule: true} in the WebPreferences for this window.", source: electron/js2c/renderer_init.js (1083)
[4352:0701/163459.940984:INFO:CONSOLE(2601)] "%cElectron Security Warning (Disabled webSecurity) font-weight: bold; This renderer process has "webSecurity" disabled. This
  exposes users of this app to severe security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2601)
[4352:0701/163459.941139:INFO:CONSOLE(2630)] "%cElectron Security Warning (allowRunningInsecureContent) font-weight: bold; This renderer process has "allowRunningInsecureContent"
  enabled. This exposes users of this app to severe security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2630)
[4352:0701/163459.941288:INFO:CONSOLE(2616)] "%cElectron Security Warning (Insecure Content-Security-Policy) font-weight: bold; This renderer process has either no Content Security
    Policy set or a policy with "unsafe-eval" enabled. This exposes users of
    this app to unnecessary security risks.

For more information and help, consult
https://electronjs.org/docs/tutorial/security.
This warning will not show up
once the app is packaged.", source: electron/js2c/renderer_init.js (2616)
[4352:0701/163459.945605:INFO:CONSOLE(277)] "checking for updates to chrome app gidgenkbbabolejbgbpnhbimgjbffefm", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (277)
[4352:0701/163459.947699:INFO:CONSOLE(32)] "https://clients2.google.com/service/update2/crx?prodversion=83.0.4103.119&x=id%3Dgidgenkbbabolejbgbpnhbimgjbffefm%26installsource%3Dondemand%26uc%3D", source: /home/pi/electron-chrome/chrome/api/chrome-update.js (32)
[4352:0701/163500.100863:INFO:CONSOLE(42)] "server version", source: /home/pi/electron-chrome/chrome/api/chrome-update.js (42)
[4352:0701/163500.101002:INFO:CONSOLE(43)] "<?xml version="1.0" encoding="UTF-8"?><gupdate xmlns="http://www.google.com/update2/response" protocol="2.0" server="prod"><daystart elapsed_days="4930" elapsed_seconds="52500"/><app appid="gidgenkbbabolejbgbpnhbimgjbffefm" cohort="" cohortname="" status="ok"><updatecheck codebase="https://clients2.googleusercontent.com/crx/blobs/QwAAAHF3InbmK-wFIemaY3I3BCP-pEKWDDeSYiszC1Ot2CMO_ey7uPR4S6HRx0laYLbd8C8MgJG5XNRlmurykLEKsV_BGdn7CINYHmzy9s-B8reTAMZSmuV6tNjcT4vyffxpVM8CtpXZEh6eVA/extension_2_3_0_0.crx" fp="1.66a033b33862233b451118fe863fa77f93989c4d29e7fe0876f426db7bd0badf" hash_sha256="66a033b33862233b451118fe863fa77f93989c4d29e7fe0876f426db7bd0badf" protected="0" size="12135295" status="ok" version="2.3.0"/></app></gupdate>", source: /home/pi/electron-chrome/chrome/api/chrome-update.js (43)
[4352:0701/163500.116671:INFO:CONSOLE(142)] "latest version of gidgenkbbabolejbgbpnhbimgjbffefm 2.3.0 vs current 2.3.0", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (142)
[4352:0701/163509.169709:INFO:CONSOLE(220)] "shutting down", source: /home/pi/electron-chrome/chrome/api/chrome-runtime.js (220)
[4352:0701/163509.206301:INFO:CONSOLE(136)] "window closed __background", source: /home/pi/electron-chrome/chrome/api/chrome-app.js (136)
[4386:0701/163509.208098:WARNING:x11_util.cc(1520)] X error received: serial 452, error_code 170 (GLXBadWindow), request_code 152, minor_code 32 (Unknown)
[4386:0701/163509.209055:WARNING:x11_util.cc(1520)] X error received: serial 456, error_code 3 (BadWindow), request_code 4, minor_code 0 (Unknown)
killing all windows for shutdown
chromeRuntimeWindow shutdown
windows remaining [
  BrowserWindow {
    setBounds: [Function],
    _events: [Object: null prototype] {
      blur: [Function],
      focus: [Function],
      show: [Array],
      hide: [Function: visibilityChanged],
      minimize: [Function: visibilityChanged],
      maximize: [Function: visibilityChanged],
      restore: [Function: visibilityChanged],
      close: [Array]
    },
    _eventsCount: 8,
    devToolsWebContents: [Getter],
    _maxListeners: 1000
  }
]
window-all-closed

Nothing showed up. No window, nothing graphical. The terminal was returned to the prompt without any obvious hints as to what's wrong.

liuhao16 commented 4 years ago

好像是有的依赖已经安装不上了

Core-commits commented 3 years ago

Hello @Botspot the issue is that you havent installed Electron correctly.

Electron is installed with the command npm install but if you read on the error. It says you dont have permission to run that command. And it's right. You dont have the right to install anything on the device if you arent root or sudo

Try running sudo npm i and repeating the the rest of the process.