准备在electron上用vue,结果卡在了sqlite3
vue.js看书有一段时间了,也准备动手做一个electron的程序。目录似乎有两种方式搭建方式
一种是使用vue.cli构建工具,就是所谓的脚手架,分别安装vue和electron
https://www.cnblogs.com/jiangxifanzhouyudu/p/9517651.html
一种是直接安装electron-vue组件,一步完成vue和electron的安装
https://blog.csdn.net/github_36978270/article/details/78460696
安装构造工具
#npm install -g vue-cli
使用构造工具创建项目
#vue init simulatedgreg/electron-vue my-project
基本上一路回车就是了。不知道的可以选择NO
在安装sqlite3后,运行程序时,死活说找不到路径,
"Error: Cannot find module 'D:\Fasaccounts\elec-fsacc\node_modules\sqlite3\lib\binding\electron-v2.0-win32-x64\node_sqlite3.node'"
检查安装后的路径,却只有
D:\Fasaccounts\elec-fsacc\node_modules\sqlite3\lib\binding\node-v64-win32-x64\node_sqlite3.node
就是后面的目录名不同。运行的程序找的是electron-v2.0-win32-x64,安装却在node-v64-win32-x64。百度之后,似乎是需要为electron重新编译,但好几个方法在两台安装了vs2017的win10上都编译不了。,直到看到这个
https://blog.csdn.net/CaanDoll/article/details/81429171
参考上面的地址的说明,我先
npm i sqlite3 --save
我没有按文章去修改package.json,于是在执行上面的命令后,我再执行
install-app-deps

于是一台电脑成功编译,另一台却找不到命令。之后找到这个一个帖子
https://stackoverflow.com/questions/32504307/how-to-use-sqlite3-module-with-electron
上面网址速度比较慢,我帖上主要回复内容
=================================================================================
By far the easiest way to use SQLite with electron is with electron-builder.
First, add a postinstall step in your package.json:
"scripts": {
"postinstall": "install-app-deps"
...
}
and then install the necessary dependencies and build:
npm install --save-dev electron-builder
npm install --save sqlite3
npm run postinstall
electron-builder will build the native module for your platform, with the correct name for the Electron binding; and you can then require it in code as normal.
===================================================================================
原来需要安装electron-builder,至此总算搞定sqlite3的安装。
准备在electron上用vue,结果卡在了sqlite3的更多相关文章
- 在nginx上部署vue项目(history模式);
在nginx上部署vue项目(history模式): vue-router 默认是hash模式,使用url的hash来模拟一个完整的url,当url改变的时候,页面不会重新加载.但是如果我们不想has ...
- Application Loader上传app,一直卡在“正在通过 App Store 进行鉴定”
1.问题现象描述 上传iOS应用,卡在 Authenticating with the iTunes Store 2.解决办法 2.1 打开终端输入代码即可 cd ~ mv .itmstranspor ...
- 在nginx上部署vue项目(history模式)--demo实列;
在很早之前,我写了一篇 关于 在nginx上部署vue项目(history模式) 但是讲的都是理论,所以今天做个demo来实战下.有必要让大家更好的理解,我发现搜索这类似的问题还是挺多的,因此在写一篇 ...
- 后台管理系统之“图片上传” --vue
图片上传(基于vue) 相信上传图片是所有系统必备的功能吧,工作中的第一个管理系统就在上传图片的功能上卡顿了一整天. 当时用的elementUI组件,但是由于样式和设计图样式差别较大再加上原生相较好理 ...
- Electron开发使用Vue Devtools
转自 [https://orchidflower.oschina.io/2017/03/29/Using-Vue-Devtools-in-Electron/] 2.2 安装步骤 首先在Chrome中安 ...
- 安卓培训第五天---上传文件SD卡
有关如何将文件上传到先说说SD卡: package com.example.lesson05_02; import java.io.File; import java.io.FileNotFoundE ...
- mac上安装vue项目
mac上如何安装vue项目 一, mac系统安装brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/H ...
- 浏览器上安装vue devtools
安装前要检查一下node版本的(node -v),必须将版本提高到>4.4.7.低版本的node在安装devtools时执行npm install 时报错.如何升级node版本,若在window ...
- 如何在mac上运行vue项目
使用终端安装Vue运行环境 1.安装 Homebrew Homebrew 是osx下面最优秀的包管理工具,没有之一.先在终端查看是否已安装brew brew -v 如果返回 Homebrew 的版本号 ...
随机推荐
- Web App Checklist
Mobile Web App checklist 目标: 高性能Mobile Web App 一.UX和UI 操作节目与边框之间留空隙: 防止操作过程中,触发系统缺省行为,有些是无法disable的. ...
- BZOJ 4872 luogu P3750 [六省联考2017]分手是祝愿
4872: [Shoi2017]分手是祝愿 Time Limit: 20 Sec Memory Limit: 512 MB[Submit][Status][Discuss] Description ...
- redis-单线程架构
单线程模型: redis中的数据结构并不全是简单的kv,还有list.hash等复杂的结构,这些结构很可能会进行细粒度的操作,比如在很长的列表偶棉添加一个元素,在hash当中或者删除一个对象,这样的一 ...
- Android 开发 系统组件集合
常用的TextView.Button.ImageView和几个常用布局就不介绍了,我们介绍一些特别好用但是常常忘记的组件. 标题栏组件 <androidx.appcompat.widget.To ...
- 表单:!!!常用JS: form 表单代码
手机(文本框): <input type="text" name="" maxlength="11" placeholder=&quo ...
- java 内部类注意点
1.只有内部类可以是私有类,而常规类只可以具有包可见性,或公有可见性. 内部类访问权限修饰符可以为:public.protected.默认.private:(可以用哪些修饰符视具体内部类类型而定) 常 ...
- PHP json_encode 文本形式数字下标数组导致下标丢失
$arr = array( '0'=>'a','1'=>'b','2'=>'c','3'=>'d' ); echo json_encode($arr); 但是结果是 [&quo ...
- python 装饰器的理解以及类装饰器
python装饰器的作用就是在不改变原有函数结构的情况下给该函数增加一个新功能,就是不入侵到原来函数里面修改代码给其增加一个新功能 先看代码 def out(fn): def inner(*args, ...
- ImportError: No module named pycocotools.coco,pycocotools/_mask.so: undefined symbol: _Py_ZeroStruct
准确的说是没有安装 pycocotools 可以借鉴下面链接: https://blog.csdn.net/ab0902cd/article/details/79085797 因为我通常用Python ...
- discuz代码转为html代码
下面附件是来自discuz的一个函数文件(原来是在source/function/function_discuzcode.php位置),已稍微修改: https://files.cnblogs.com ...