electron

Electron app cant find sqlite3 module

匿名 (未验证) 提交于 2019-12-03 01:47:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: In my electron app I have installed sqlite3 via npm npm install sqlite3 But once i try to interact with the database it cant find the database, here is the log: Uncaught Error: Cannot find module 'D:\play\electron-quick-start\node_modules\sqlite3\lib\binding\electron-v1.3-win32-x64\node_sqlite3.node' Here is JS code: console . log ( 'whooooo' ); var sqlite3 = require ( 'sqlite3' ). verbose (); var db = new sqlite3 . Database ( '../db/info.db' ); db . serialize ( function () { db . run ( "CREATE TABLE lorem (info TEXT)" ); var stmt

'electron-packager' is not recognized as an internal or external command

匿名 (未验证) 提交于 2019-12-03 01:38:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I recently started using electron. I have successfully completed the 1st phase by creating a hello world app (included files index.html, main.js, package.json). Now I am trying to package the app using electron-packager but getting this error Steps I have followed: Created a project directory named helloworld. Initialized the project directory using npm init command. Then installed electron using npm install electron --save-dev . Then created the javascript and html files as main.js and index.html respectively. Then used npm start to execute

Electron (chromium) disable web security

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Is there a way to disable web security on Electron (chromium)? Via JavaScript or something? 回答1: Found it: new BrowserWindow({webPreferences: {webSecurity: false}}); 回答2: mainWindow = new BrowserWindow({ 'web-preferences': {'web-security': false}, width: 1800, height: 1600, }); web preferences part fixed the issue for me.if it didn't work try app.commandLine.appendSwitch('disable-web-security'); mainWindow = new BrowserWindow({ 'node-integration': 'iframe', 'web-preferences': {'web-security': false}, width: 1800, height: 1600, }); 回答3: In

How to import Electron in angular 2 using angular cli

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm trying to prototype an Electron app using Angular 2 (configured with the latest webpack-based angular cli) for the gui, but I'm stuck since I don't get how to import Electron api in my angular2 components. Specifically I want to be able to open a new BrowserWindow at the click on a button in the ui... so: <button type = "button" ( click ) = "openNewWindow()" > open </button> and in my component: openNewWindow () { let appWindow = new BrowserWindow ({ width : 800 , height : 600 }); appWindow . loadUrl ( 'http://www.google.com' )

Close Electron frameless window not working

匿名 (未验证) 提交于 2019-12-03 01:34:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I'm building an app using electron 1.0 and unfortunately everywhere I look for guides and tutorials with it, no one uses electron 1 because it's so new. I am trying to close a frameless window through the click of a button I made. I know the button works because I have check to make sure it can do simple things (i.e. change some text or whatever) but that's only when I use internal javascript but I am trying to use external javascript. When I use external the function never gets called... const { remote } = require ( 'electron' );

Python on Electron framework

雨燕双飞 提交于 2019-12-03 01:32:56
问题 I am trying to write a cross-platform desktop app using web technologies (HTML5, CSS, and JS). I took a look at some frameworks and decided to use the Electron framework. I've already done the app in Python, so I want to know if is possible to write cross-platform desktop applications using Python on the Electron framework? Thank you 回答1: It is possible to work with Electron but if you are looking for "webbish" UI capabilities, you can check Flexx - it allows you to code in pure Python but

node module version conflict when installing modules for electron

匿名 (未验证) 提交于 2019-12-03 01:27:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm trying to make an Electron application ( https://electron.atom.io/ ) that reads data from my serial port. I'm new to web technologies in general, I know some javascript, but I'm a c++ guy. So I pulled in their quick-start from github, ran npm install && npm start With this easily working I tried to install and run serialport with npm install serialport With that installed and running fine with a test file, I tried to combine the two and put require('serialport') in the index.html file. With this in there I get this error: Uncaught Error:

Electron Uncaught Error: A dynamic link library (DLL) initialization routine failed

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've successfully built node.js addon, which works well with Node on Windows. Now, I want to create a Windows app using Electron. When loading the module in HTML file, I got the error: var dbr = require('./build/Release/dbr'); Something wrong with ATOM_SHELL_ASAR.js . The issue only occurred on Windows. On Linux and Mac, it worked well. How can I fix it? Thanks! 回答1: You need to rebuild your native Node addon for Electron, the steps are outlined in the docs . 回答2: I'm using Electron 2 version and have the same error with another module. I

could not install electron in windows 10

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: Hi I am trying to install electron in my windows system using this following commands. - npm install -g electron - npm install electron - npm install electron --save-dev For all these command I am getting the following error. C:\Users\abc\Desktop\final\new>electron@ 'electron@' is not recognized as an internal or external command, operable program or batch file. C:\Users\abc\Desktop\final\new>npm install electron > electron@1.6.6 postinstall C:\Users\abc\Desktop\final\new\node_modules\electron > node install.js C:\Users\abc\Desktop\final\new