gpt4 book ai didi

node.js - 令人困惑的 NODE_MODULE 错误

转载 作者:太空宇宙 更新时间:2023-11-03 22:25:51 25 4
gpt4 key购买 nike

我正在使用 greenworks SDK。我不明白这个错误消息。我无法判断它是否告诉我重新编译 greenworks-osx64.node 或更改我的系统 Node 设置。

ELECTRON_ASAR.js:173 Uncaught Error: The module '/Users/quantum/ele/electron-quick-start/lib/greenworks-osx64.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 57. This version of Node.js requires
NODE_MODULE_VERSION 53. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or`npm install`).
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:173:20)
at Object.Module._extensions..node (module.js:598:18)
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:173:20)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/Users/quantum/ele/electron-quick-start/greenworks.js:12:18)
at Object.<anonymous> (/Users/quantum/ele/electron-quick-start/greenworks.js:133:3)

我正在使用 Electron ~1.6.2 和 node -v v8.6.0

我错过了页面下方还有其他版本。我安装了 Electron 1.6.1 的版本。现在我的代码运行如下:

var greenworks = require('./greenworks'); var f = greenworks.initAPI();文档.write(f);控制台.log(f);

“false”登录到控制台。

最佳答案

The native Node modules are supported by Electron, but since Electron is very likely to use a different V8 version from the Node binary installed in your system, you have to manually specify the location of Electron's headers when building native modules.

来源:here

关于node.js - 令人困惑的 NODE_MODULE 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46549838/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com