【问题标题】:Cannot get serialport to work for johnny-five: Node_Module_Version Error无法让 serialport 为 johnny-five 工作:Node_Module_Version 错误
【发布时间】:2023-01-28 15:55:00
【问题描述】:
/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 109. This version of Node.js requires
NODE_MODULE_VERSION 111. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Module._extensions..node (undefined:1243:18)
    at Module.load (undefined:1037:32)
    at Module._load (undefined:878:12)
    at Module.require (undefined:1061:19)
    at require (undefined:103:18)
    at bindings (undefined:112:48)
    at <anonymous> (undefined:2:36)
    at Module._compile (undefined:1159:14)
    at Module._extensions..js (undefined:1213:10)
    at Module.load (undefined:1037:32)
    at Module._load (undefined:878:12)
    at Module.require (undefined:1061:19)
    at require (undefined:103:18)
    at <anonymous> (undefined:10:22)
    at Module._compile (undefined:1159:14)
    at Module._extensions..js (undefined:1213:10)
    at Module.load (undefined:1037:32)
    at Module._load (undefined:878:12)
    at Module.require (undefined:1061:19)
    at require (undefined:103:18)
    at <anonymous> (undefined:2:17)
    at Module._compile (undefined:1159:14)
    at Module._extensions..js (undefined:1213:10)
    at Module.load (undefined:1037:32)
    at Module._load (undefined:878:12)
    at Module.require (undefined:1061:19)
    at require (undefined:103:18)
    at detect (undefined:35:20)
    at Board (undefined:291:23)
    at <anonymous> (undefined:2:13)
    at Module._compile (undefined:1159:14)
    at Module._extensions..js (undefined:1213:10)
    at Module.load (undefined:1037:32)
    at Module._load (undefined:878:12)
    at executeUserEntryPoint (undefined:82:12)
    at <anonymous> (undefined:23:47)

我已经尝试了我可以在互联网上搜索的所有内容,包括:npm 重建、卸载和重新安装、电子重建等。我已经升级了 node-sass,重新安装了 node-gyp 以及 pre-node-gyp。当我在终端中运行以下命令时

./node_modules/.bin/electron-rebuild

我收到错误(为了长度而缩短):

In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:68:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/cdefs.h:807:2: error: Unsupported architecture
#error Unsupported architecture
 ^
In file included from ../src/serialport.cpp:1:
In file included from ../src/./serialport.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:33:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/machine/_types.h:34:2: error: architecture not supported
#error architecture not supported
 ^
In file included from ../src/serialport.cpp:1:
In file included from ../src/./serialport.h:11:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/stdio.h:107:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/stdio.h:64:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_stdio.h:71:
In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/_types.h:27:
/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include/sys/_types.h:55:9: error: unknown type name '__int64_t'
typedef __int64_t       __darwin_blkcnt_t;      /* total blocks */
        ^

任何人都可以帮忙吗?

【问题讨论】:

    标签: node.js arduino serial-port johnny-five


    【解决方案1】:

    很抱歉我不能解决你的问题。 因为我遇到了另一个与你相似的问题

    错误:模块'/Users/c1oud/Projects/dx-desktop/node_modules/@akiflow/electron-panel-window/build/Release/NativeExtension.node' 是针对不同的 Node.js 版本编译的 NODE_MODULE_VERSION 108. 这个版本的 Node.js 需要 NODE_MODULE_VERSION 109. 请尝试重新编译或重新安装 模块(例如,使用npm rebuildnpm install)。、

    你能告诉我你用的是什么节点版本吗?我想知道如何 得到 NODE_MODULE_VERSION 109。

    谢谢

    【讨论】:

      猜你喜欢
      • 2015-04-09
      • 2016-12-29
      • 2015-02-23
      • 1970-01-01
      • 1970-01-01
      • 2016-05-05
      • 1970-01-01
      • 2013-07-15
      • 2016-05-07
      相关资源
      最近更新 更多