使用 nw-gyp 构建 node-sqlite3

2024-05-17

我正在尝试为 node-webkit 构建 sqlite3。

The sqlite3 https://www.npmjs.com/package/sqlite3#installing页面解释说它需要使用 nw-gyp 来完成

据我了解,我应该下载source https://github.com/mapbox/node-sqlite3本地,然后导航到 src 文件夹并运行此(此处显示 https://www.npmjs.com/package/sqlite3#installing):

npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=$(NODE_WEBKIT_VERSION)

问题是,无论我在什么位置运行该命令,我都会收到以下错误:

  • npm 警告 package.json[电子邮件受保护] /cdn-cgi/l/email-protection没有许可证字段。
  • npm WARN install 拒绝安装 sqlite3 作为其自身的依赖项
  • npm WARN node-pre-gyp 与 sq 捆绑在一起[电子邮件受保护] /cdn-cgi/l/email-protection,但在解压树中找不到捆绑包。

也许我这样做完全错误,我只是不知道:)

NW-gyp版本:V0.12.4 Node-webkit 版本:0.12.3

操作系统:Windows 7

我向成功迈出了一小步,但还没有到达。看来我应该在空文件夹中尝试该命令。所以我这样做了,但现在我有很多错误。

第一个错误是:

错误:如果 node-webkit 是目标,则不支持空目标版本。然后是很多堆栈错误。

第一个堆栈是:位于 get_node_webkit_abi (文件的完整路径) utils/versioning.js

更多更新: 该命令消除了许多错误:

 npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=0.12.3

然后就出现找不到Pything的错误。这是固定的。现在使用 C++ 编译器仍然会出现更多错误。我认为我对 NET 可再发行版本的态度完全混乱。

下一个错误是: 错误 MSB6006:“CL.exe”退出,代码为 -1073741515

This is the error I am getting now: enter image description here

More improvements. I am getting error: undefined variable module_name in binding.gyp enter image description here

我所做的后续步骤:

  • 我安装了 npm install -g node-pre-gyp

  • 比我运行node-pre-gyp重建 --runtime=node-webkit --target=0.12.3

  • 这给了我错误缺少 nan 模块丢失

  • 我安装了

  • 我得到的屏幕与第一个屏幕截图 (MSB6006) 中的屏幕相同。


我设法在 mac 上使用以下命令进行构建:

sudo npm install nw-gyp -g
npm install sqlite3 --build-from-source --runtime=node-webkit --target_arch=ia32 --target=0.12.3

首先,确保你安装了nw-gyp全球。然后,在包含 node-webkit 可执行文件 (nwjs) 的目录或该文件夹的子文件夹中运行该命令。

运行该命令应该会创建一个node_modules与二进制文件位于同一目录中的文件夹,包含sqlite3模块。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

使用 nw-gyp 构建 node-sqlite3 的相关文章

随机推荐