系统 WIN10 X64

1. python-2.7.15.amd64.msi

2. node-v10.4.1-x64.msi

3. VS2015 community(社区版)

4. npm config set registry https://registry.npm.taobao.org  设置淘宝镜像

5. npm install npm -g 安装最新npm

6. npm install node-pre-gyp -g  && npm install node-gyp -g

7. (简单的案例:electron-quick-start )git clone https://github.com/electron/electron-quick-start

进入electron-quick-start文件夹下 npm install 把需要的模块下载安装 npm start启动可以看到这个简单的案例

===========================

上述就是一个常规的流程

因为我的项目中使用sqlite3 ,所以之前是用npm install sqlite3 --save安装的

(--save 是添加到dependencies,是需要发布到生产环境的;devDependencies 里面的插件只用于开发环境,不用于生产环境)

之前electron 2.0.0下编译的可以加载使用sqlite3,升级后electron是2.0.2的, 需要重新编译

进入 ./node_modules/sqlite3/ 文件夹下重新执行了编译  node-pre-gyp rebuild --runtime=electron --target_arch=x64 --target=2.0.2

npm start 我的程序的时候

var sqlite3 = require("sqlite3").verbose();
 
报错

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

因为electron和node.js用的V8版本不一致,所以直接使用npm安装的模块可能在electron中不可用,特别是使用c、c++开发的模块。

npm install --save-dev electron-rebuild

./node_modules/.bin/electron-rebuild
在windows下如果上述命令遇到了问题,可以尝试使用下面这个:
.\node_modules\.bin\electron-rebuild.cmd

最后提示
√ Rebuild Complete
 
npm start 程序启动后已经不提示错误,正确引用了sqlite3

electron安装与使用的更多相关文章

  1. electron 安装

    1.从网上下载的是nodejs的v0.10.42版本的安装文件,安装node-v0.10.42-x86.msi都使用默认安装,安装完成后会安装在C:\Program Files\nodejs\目录下, ...

  2. Electron安装过程深入解析(读完此文解决Electron应用无法启动,无法打包的问题)

    1. 安装Electron依赖包 开发者往往通过npm install(或 yarn add)指令完成为Node.js工程安装依赖包的工作, 安装Electron也不例外,下面是npm和yarn的安装 ...

  3. Electron安装

    1.安装nodejs和npm 官网下载地址:https://nodejs.org/en/download/ 安装包:下载.msi 安装完成后: nodejs.npm都会安装好,path环境变量也自动设 ...

  4. electron安装+运行+打包成桌面应用+打包成安装文件+开机自启动

    1.初始化node项目,生成package.json文件 npm init 2.安装electron,并保存为开发依赖项 npm install electron -D 3.根目录下新建index.j ...

  5. electron安装到第一个实例

    1.node.js下载,然后安装.下载地址:链接:http://pan.baidu.com/s/1o7TONhS 密码:fosa 2.cmd下输入:npm install electron-prebu ...

  6. Electron 安装与使用

    Electron是使用 JavaScript, HTML 和 CSS 构建跨平台的桌面应用 本文基于Windows进行开发的过程,记录下来,以便日后使用,Electron官网:https://elec ...

  7. electron 安装失败解决办法

    1.安装node https://nodejs.org/en/download/2.安装镜像工具npm install -g cnpm --registry=https://registry.npm. ...

  8. electron 安装使用

    1.安装 node.js 链接:http://pan.baidu.com/s/1o7W7BIy 密码:y6od 一路next 我安装在F:\Program Files\node.js下 2.检查nod ...

  9. 为Electron 安装 vue-devtool等扩展

    相关代码: https://github.com/WozHuang/Barrage-helper/blob/master/src/main/index.dev.js 在SPA逐渐成为构建优秀交互体验应 ...

随机推荐

  1. August 06th 2017 Week 32nd Sunday

    No words are necessary between two loving hearts. 两颗相爱的心之间不需要言语. No, I don't think so. Words may be ...

  2. 【转】ios 抓取 tcp/udp 包

    原文: http://useyourloaf.com/blog/2012/02/07/remote-packet-capture-for-ios-devices.html Remote Packet ...

  3. jwplayer视频--不兼容IE8

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  4. oracle exp 无法导出空表

    oracle exp 无法导出空表   select 'alter table '|| a.table_name ||' allocate extent;' from user_tables a wh ...

  5. 一句话解释:C2C / B2C / O2O / B2B

    C2C (Customers To Customers):个人到个人,就是我卖东西你来买B2C (Business To Customers):公司到个人,就是我成立个公司卖东西,你来买O2O (On ...

  6. xss实现获取内网ip

    前提得浏览器支持webRTC,测试的时候google浏览器测试成功,火狐浏览器不支持webRTC, 再在xss平台直接复制如下js代码: function form_ip(ip,port){ var ...

  7. Linux 问题处理集锦

    安装nginx,编译过程中遇到的问题 wget command not found yum -y install wget c compiler cc is not found yum -y inst ...

  8. LWIP network interface 网卡 初始化 以 STM32 为例子 后面会有 用 2G 或者4G 模块 用 PPP拨号的 形式 虚拟出网卡 所以先以 这个为 前提

    LWIP   network interface   网卡 初始化    以  STM32  为例子  后面会有 用  2G 或者4G 模块 用 PPP拨号的 形式  虚拟出网卡  所以先以 这个为 ...

  9. 解决Js跨域访问的问题

    1,最近有个需求,用Js获取Html标签<input type="file"/>的路径!遇到代码拒绝访问,提示安全验证,不允许跨域访问,简单的设置一下浏览器即可,不过对 ...

  10. 容易忽略的expect脚本问题,暗藏的僵尸进程,wait命令不要漏掉

    问题描述 前几天有个小需求,用到expect脚本去循环的发送一些数据,主要问题代码如下: #! /usr/bin/expect while {true} { set timeout 60 spawn ...