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的更多相关文章

  1. 在nginx上部署vue项目(history模式);

    在nginx上部署vue项目(history模式): vue-router 默认是hash模式,使用url的hash来模拟一个完整的url,当url改变的时候,页面不会重新加载.但是如果我们不想has ...

  2. Application Loader上传app,一直卡在“正在通过 App Store 进行鉴定”

    1.问题现象描述 上传iOS应用,卡在 Authenticating with the iTunes Store 2.解决办法 2.1 打开终端输入代码即可 cd ~ mv .itmstranspor ...

  3. 在nginx上部署vue项目(history模式)--demo实列;

    在很早之前,我写了一篇 关于 在nginx上部署vue项目(history模式) 但是讲的都是理论,所以今天做个demo来实战下.有必要让大家更好的理解,我发现搜索这类似的问题还是挺多的,因此在写一篇 ...

  4. 后台管理系统之“图片上传” --vue

    图片上传(基于vue) 相信上传图片是所有系统必备的功能吧,工作中的第一个管理系统就在上传图片的功能上卡顿了一整天. 当时用的elementUI组件,但是由于样式和设计图样式差别较大再加上原生相较好理 ...

  5. Electron开发使用Vue Devtools

    转自 [https://orchidflower.oschina.io/2017/03/29/Using-Vue-Devtools-in-Electron/] 2.2 安装步骤 首先在Chrome中安 ...

  6. 安卓培训第五天---上传文件SD卡

    有关如何将文件上传到先说说SD卡: package com.example.lesson05_02; import java.io.File; import java.io.FileNotFoundE ...

  7. mac上安装vue项目

    mac上如何安装vue项目 一, mac系统安装brew /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/H ...

  8. 浏览器上安装vue devtools

    安装前要检查一下node版本的(node -v),必须将版本提高到>4.4.7.低版本的node在安装devtools时执行npm install 时报错.如何升级node版本,若在window ...

  9. 如何在mac上运行vue项目

    使用终端安装Vue运行环境 1.安装 Homebrew Homebrew 是osx下面最优秀的包管理工具,没有之一.先在终端查看是否已安装brew brew -v 如果返回 Homebrew 的版本号 ...

随机推荐

  1. liunx 部署 spring boot

    Xshell for Xmanager Enterprise 4 (Build 0232)Copyright (c) 2002-2014 NetSarang Computer, Inc. All ri ...

  2. Java面试——线程池

    1.类比介绍 假如有一个工厂,工厂里面有10个工人,每个工人同时只能做一件任务. 因此只要当10个工人中有工人是空闲的,来了任务就分配给空闲的工人做: 当10个工人都有任务在做时,如果还来了任务,就把 ...

  3. leetcode617

    这道题想了很久,并没有掌握思想,写了很多,也没有解决.先贴出思考的过程. class Solution { public: vector<TreeNode> v1; vector<T ...

  4. <记录> PHP读取命令行参数

    方法一:使用$argv or $argc参数接收 echo "接收到{$argc}个参数"; print_r($argv); [root@DELL113 lee]# /usr/lo ...

  5. ABAP-加密解密

    report zco_test. data:o_encryptor type ref to cl_hard_wired_encryptor, o_cx_encrypt_error type ref t ...

  6. DOCKER解析(转)

    Docker基本概念详解 本文只是对Docker的概念做了较为详细的介绍,并不涉及一些像Docker环境的安装以及Docker的一些常见操作和命令. 阅读本文大概需要15分钟,通过阅读本文你将知道一下 ...

  7. list中null或者空的区别

    1.list 空 默认值是空,即没有值 null 理解为没有对list集合分配内存空间,实际上压根就不存在. 也可以这样理解: null  未建立对象 空    建立对象未放入值 例如  我有一个空着 ...

  8. day41 mysql详细操作

    复习 create table 表名( id int primary key auto_increment, 字段名 数据类型[(宽度) 约束] )engine=innodb charset=utf8 ...

  9. Discuz!开发之HTML转Discuz代码(bbcode)函数html2bbcode()

    定义文件:\source\function\function_editor.php函数定义: function html2bbcode($text) { $text = strip_tags($tex ...

  10. C++中的inline用法