V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
a251922581
V2EX  ›  Node.js

Electron 环境下装了 Sqlite3 后,每次再装新的包都提示 Sqlite3 找不到模块,要重新编译 Sqlite3 才行

  •  
  •   a251922581 · Oct 12, 2017 · 4220 views
    This topic created in 3132 days ago, the information mentioned may be changed or developed.
    Electron 下,用了 Sqlite3,从此每次安装了新的包打开 Electron 都提示 Cannot find module..... node_sqlite3.node
    用./node_modules/.bin/electron-rebuild -w sqlite3 -p 重新编译才行。。
    编译起来比较费事啊,每次编译都要至少一分多钟。。
    另外问一句为什么 Electron 要重新编译模块呢?难道 Sqlite3 模块是 C 语言写的?
    2 replies    2017-10-13 17:38:14 +08:00
    oott123
        1
    oott123  
       Oct 12, 2017 via Android
    是啊,sqlite3 是个原生模块。
    lrh3321
        2
    lrh3321  
       Oct 13, 2017
    是啊,所以我放弃使用 sqlite3,改用 nedb 了
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   862 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 20:27 · PVG 04:27 · LAX 13:27 · JFK 16:27
    ♥ Do have faith in what you're doing.