electron

electron 下使用 node-gyp 编译 node-serialport 的细节,可修改国内源。

只愿长相守 提交于 2020-02-04 01:52:09
在 https://npm.taobao.org/mirrors 中可以看到一个页面说明了很多源,注意在用的时候可以按提示去载入。 如我在编译 serialport 的 build/binding.sln 时,就因为自带源始终无法下载 iojs 。 gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Juwan\\Documents\\GitHub\\electron-vue-admin\\node_modules\\electron-rebuild\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" "--target=1.8.8" "--arch=ia32" "--dist-url=https://electronjs.org/headers" "--build-from-source" gyp ERR! cwd C:\Users\Juwan\Documents\GitHub\electron-vue-admin\node_modules\@serialport 因此下去该文件夹进行 node-gyp 的手动编译,添加新指向就可以下载完成并编译了。 node-gyp rebuild --target=1.8.8 --arch=ia32 -

electron——初探

末鹿安然 提交于 2020-02-02 08:15:05
是什么? Electron是由Github开发,用HTML,CSS和JavaScript来构建跨平台桌面应用程序的一个开源库。 Electron通过将Chromium和Node.js合并到同一个运行时环境中,并将其打包为Mac,Windows和Linux系统下的应用来实现这一目的。 为什么选择electron? 先来看一下官方的两句话 使用 JavaScript, HTML 和 CSS 构建跨平台的桌面应用 如果你可以建一个网站,你就可以建一个桌面应用程序。 Electron 是一个使用 JavaScript, HTML 和 CSS 等 Web 技术创建原生程序的框架,它负责比较难搞的部分,你只需把精力放在你的应用的核心上即可。 如果你是一个前端,你就明白这个有多简单了 哦,对了!或许你还不知道, Visual Studio Code 、 wordpress 和 slack 等客户端都是基于 Electron 开发的。 1.可以用 Web 前端技术开发跨平台的桌面客户端 这是 Electron 最迷人的地方,究其根本是因为它是建立在 Chromium 和 Node 之上的,一个负责界面,一个负责背后的逻辑,有句话怎么说来着 你负责貌美如花,我负责赚钱养家 ,所以Electron 能够开发跨平台的桌面应用也就可以理解了。 作为一名前端小菜鸟来说: 可以用自己熟悉的方式去写应用界面

How to use electron's app.getPath() to store data?

拥有回忆 提交于 2020-02-01 02:12:26
问题 I want to store images on the users computer, so I figure it should be stored in users data folder, as described here. app.getPath(name) name . Returns String - A path to a special directory or file associated with name. On failure an Error is thrown. You can request the following paths by the name: home User's home directory appData Per-user application data directory, which by default points to: %APPDATA% on Windows $XDG_CONFIG_HOME or ~/.config on Linux ~/Library/Application Support on

Why do Node modules go into .staging folder?

走远了吗. 提交于 2020-01-31 06:08:26
问题 I have an Electron app that I'm trying to install node modules for. When I run npm install , it creates the node_modules folder but all the modules go into a subfolder called .staging . Each module also has -xxxxx appended to it, where the x's are some random alphanumerics. Other Electron apps I've created have never done this. All the node modules sit in the root of node_modules and don't have -xxxxx appended. Any idea why this is happening? 回答1: This only happens temporarily until the

Electron开发实战

别来无恙 提交于 2020-01-31 05:02:52
Electron开发实战 🎈开头 使用 JavaScript, HTML 和 CSS 构建跨平台的桌面应用对于前端开发人员来说,应该是一件非常酷的事情! 感谢 Electron 为前端开发提供了多一种功能。 以下是我的学习经历,如有不对,欢迎指正,谢谢! 📝 章节目录 基础API篇 第一章-征程 第二章-主进程与渲染进程 第三章-H5拖拽读取本地文件 第四章-快捷键注册及复制粘贴 第五章-渲染进程调用主进程模块 第六章-菜单模块 第七章-渲染进程与主进程间的通信 第八章-渲染进程与渲染进程间的通信 第九章-管理应用程序文件及url的加载方式 第十章-系统对话框模块 练习 实现一个编辑器 项目 七牛云图床 来源: CSDN 作者: 取个名字真麻烦啊 链接: https://blog.csdn.net/luojinxu520/article/details/104116114

Is it possible to use c++ as back-end for Electron.js?

坚强是说给别人听的谎言 提交于 2020-01-31 01:53:46
问题 I have a task to make simple c++ app which stores information into binary files, then need to make simple manipulations with this info, like edit,delete,read. I wanted to create desktop app using Electron for designing UI and to use c++ for manipulation with information. Is it possible and how can i include c++ into electron, is there any tutorials? Thanks in advance. 回答1: Electron is using nodejs, so you can still package cpp code as a node module and then use it as dependency in your

Is it possible to use c++ as back-end for Electron.js?

▼魔方 西西 提交于 2020-01-31 01:53:24
问题 I have a task to make simple c++ app which stores information into binary files, then need to make simple manipulations with this info, like edit,delete,read. I wanted to create desktop app using Electron for designing UI and to use c++ for manipulation with information. Is it possible and how can i include c++ into electron, is there any tutorials? Thanks in advance. 回答1: Electron is using nodejs, so you can still package cpp code as a node module and then use it as dependency in your

How to clear the cache data in Electron(atom shell)?

流过昼夜 提交于 2020-01-30 17:49:53
问题 I want to clear cache data in Electron(atom-shell). I don't find any api like gui.App.clearCache()(node-webkit api to clear cache data) in Electron. If you find any api or any other way please let me know. comments are appreciated . 回答1: The Electron stores it's cache in these folders: Windows: C:\Users\<user>\AppData\Roaming\<yourAppName>\Cache Linux: /home/<user>/.config/<yourAppName>/Cache OS X: /Users/<user>/Library/Application Support/<yourAppName>/Cache So deleting these folders can

How To Compile An Electron Application To A .exe [duplicate]

妖精的绣舞 提交于 2020-01-30 14:04:13
问题 This question already has answers here : How to deploy an Electron app as an executable or installable in Windows? (7 answers) Closed 2 years ago . I've been learning how to create applications in Electron and I need help compiling a simple project to a Windows executable. The program is a clone from this Github repo: https://github.com/electron/electron-quick-start. On the repo readme it shows how to run the program: # Clone this repository git clone https://github.com/electron/electron

How can i open an exe file using a button inElectron

核能气质少年 提交于 2020-01-30 08:16:16
问题 I am trying to make a button open an exe file in computer but it doesn't open and it gives me this error Uncaught ReferenceError: require is not defined at runExe (main.js:61) at HTMLButtonElement.onclick here is the code for my button <button onclick="runExe()" id="button">click</button> and i got this code form the internet and when i remove the function runExe() the exe file opens when i start the app and i want it to only open when button is clicked. here is the code to open the exe file