6

sqlite 编译需要 NODE_MODULE_VERSION 76,但是找不到对应 node 版本

 2 years ago
source link: https://www.v2ex.com/t/844663
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

V2EX  ›  Node.js

sqlite 编译需要 NODE_MODULE_VERSION 76,但是找不到对应 node 版本

  MuscleOf2016 · 1 小时 21 分钟前 · 159 次点击

根据 node 官网的版本记录: https://nodejs.org/zh-cn/download/releases/ 直接从 NODE_MODULE_VERSION 72 ,跳过到了 79 ,那现在提示 NODE_MODULE_VERSION 76 ,我该咋办。。。实现没办法了。。

7 条回复    2022-04-03 01:05:45 +08:00

Kasumi20

Kasumi20      1 小时 15 分钟前

WFT ? SQLite 是 ANSI-C 源代码。它必须先编译成机器代码才能使用。本文是编译 SQLite 的各种方法的指南。

https://www.sqlite.org/howtocompile.html

MuscleOf2016

MuscleOf2016      1 小时 14 分钟前

@Kasumi20 少打了 是 node 的 better-sqlite3

MuscleOf2016

MuscleOf2016      1 小时 3 分钟前

@Kasumi20 已经安装了全局的 node-gyp ,
```
Uncaught Error: The module '\\?\D:\better-sqlite3\build\better_sqlite3.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 79. This version of Node.js requires NODE_MODULE_VERSION 76. Please try re-compiling or re-installing the module (for instance, using npm rebuildornpm install).
```
我很奇怪,提示我需要 76 版本,但是我找不到 76 对应的 node 版本号

skies457

skies457      23 分钟前 via iPhone

@MuscleOf2016 这说的是你的 nodejs 是 76 ,但库是 79 编译的,所以你需要 79 的 nodejs

cweijan

cweijan      13 分钟前

是因为 sqlite 内置了一个编译后的.node 文件, 和你的 nodejs 版本不兼容, 如果你安装了 node-gyp 的话, 就会 npm install 时使用 node-gyp 重新编译, 使用 node-gyp 需要 gcc 编译工具, 如果是 windows, 通过执行`npm install -g windows-build-tools`安装.

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK