Sheshank S.
Sheshank S.

Reputation: 3298

Serialport module compiled against different node version

I know there is another question like this, but none of those answers work for me.

This is the error:

Uncaught Error: The module '/Users/sheshankshankar/Documents/serial-monitor-app/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 70. This version of Node.js requires
NODE_MODULE_VERSION 73. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at process.func (electron/js2c/asar.js:155)
    at process.func [as dlopen] (electron/js2c/asar.js:155)
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:828)
    at Object.func (electron/js2c/asar.js:155)
    at Object.func [as .node] (electron/js2c/asar.js:155)
    at Module.load (internal/modules/cjs/loader.js:645)
    at Function.Module._load (internal/modules/cjs/loader.js:560)
    at Module.require (internal/modules/cjs/loader.js:685)
    at require (internal/modules/cjs/helpers.js:16)
    at bindings (/Users/sheshankshankar/Documents/serial-monitor-app/node_modules/bindings/bindings.js:112)

The code is here. Doing the following should install it.

git clone https://github.com/GreenBayRules/serial-monitor-app.git
# Go into the repository
cd serial-monitor-app
# Install dependencies
npm install
# Run the app
npm start

But it doesn't. I get that error. I've tried the following:

npm install

npm rebuild

yarn install --force

removing node_modules

and pretty much every other answer here: Node - was compiled against a different Node.js version using NODE_MODULE_VERSION 51

My node version is v10.16.3

Upvotes: 1

Views: 2192

Answers (2)

Syed Usama Tanveer
Syed Usama Tanveer

Reputation: 11

First install electron and electron builder by using npm i electron electron-builder then move this dependencies inside devdependencies and then run following scripts

Upvotes: 0

Muhammad Habib
Muhammad Habib

Reputation: 400

I was facing the same error on electron bindings.node was compiled against a different Node.js version using NODE_MODULE_VERSION 72. This version of Node.js requires NODE_MODULE_VERSION 75.

On windows 7, using electron 7. I solved it by using electron-builder.

My scripts in package.json

"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"electron": "ng build --base-href ./ && tsc --p electron && electron .",
"pack": "electron-builder --dir",
"dist": "electron-builder"
},

Running "npm run dist" solved the issue

Upvotes: 1

Related Questions