简体   繁体   中英

bindings.node' was compiled against a different Node.js version usingNODE_MODULE_VERSION 93. This version of Node.js requires NODE_MODULE_VERSION 89

I am trying to make an electron app run on my pc. On ubuntu it works, i am having issues with windows. When i try to run my application i get this error

The module '\?\C:\Users\david\Desktop\Serial_Communication\node_modules@serialport\bindings\build\Release\bindings.node' was compiled against a different Node.js version using
NODE_MODULE_VERSION 93. This version of Node.js requires
NODE_MODULE_VERSION 89.
Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install ).
at process.func [as dlopen] (electron/js2c/asar_bundle.js:5:1846)
at Object.Module._extensions..node (internal/modules/cjs/loader.js:1138:18)
at Object.func [as.node] (electron/js2c/asar_bundle.js:5:1846)
at Module.load (internal/modules/cjs/loader.js:935:32)
at Module._load (internal/modules/cjs/loader.js:776:14)
at Function.f._load (electron/js2c/asar_bundle.js:5:12913)
at Module.require (internal/modules/cjs/loader.js:959:19)
at require (internal/modules/cjs/helpers.js:88:18)
at bindings (C:\Users\david\Desktop\Serial_Communication\node_modules\bindings\bindings.js:112:48)
at Object. (C:\Users\david\Desktop\Serial_Communication\node_modules@serialport\bindings\lib\win32.js:1:36)

I have already tried npm install, npm rebuild, electron-rebuild, and it does not work. It seems also strange to me that it suggests me to use an older version of Node, any ideas? Thank you

I solved the issue. I used this link https://github.com/serialport/node-serialport/releases/tag/%40serialport%2Fbindings%409.2.0 and downloaded the version v89 of the binding module. Then i manually imported that version into the @serialport/bindings folder.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM