0

i get this error when i try to start my electron app using npm start i have search all over the web and tried possible solutions but error still persist. please help

Error: The module '\?\C:\wamp64\www\tollgridApp\node_modules@pokusew\pcsclite\build\Release\pcsclite.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 83. This version of Node.js requires NODE_MODULE_VERSION 82. Please try re-compiling or re-installing the module (for instance, using npm rebuild or npm install).

this is my package.json

 {
  "name": "app",
  "version": "1.0.0",
  "description": "",
  "main": "main.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "electron .",
    "postinstall": "electron-rebuild",
    "electron-rebuild": "electron-rebuild"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "@pokusew/pcsclite": "^0.6.0",
    "electron": "^10.1.3",
    "jquery": "^3.5.1",
  },
  "devDependencies": {
    "electron-rebuild": "^2.2.0"
  }
}
justice
  • 75
  • 1
  • 2
  • 11
  • https://stackoverflow.com/questions/63794519/serialport-for-electron-node-module-version-error-and-rebuild-does-not-fix – Phix Oct 12 '20 at 17:16
  • i have already visited that and tried but still error persist – justice Oct 12 '20 at 17:20

1 Answers1

0

You need to rebuild your application using electron-rebuild package. I had the same problem and it happened because I downgraded to Node 17.9.1.

  • Open Nodejs command prompt
  • Go to your location using cd command
  • Install electron-rebuild: npm install --save-dev electron-rebuild
  • Run this command .\node_modules\.bin\electron-rebuild.cmd
Mateo
  • 11
  • 1