1. npm install -g node-gyp
2. npm install serialport -S
3. npm install electron-rebuild -D
4. ./node_modules/.bin/electron-rebuild.cmd
and after that, the rebuild process is completed.
When I execute the command: npm run electron:serve
, I encounter an error in the browser's Electron inspector similar to this.
If I inspect the bindings.js
code, I can pinpoint the error:
nodePreGyp:
'node-v' +
process.versions.modules
Here is a snippet from my package.json file:
{"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint",
"electron:build": "vue-cli-service electron:build",
"electron:serve": "vue-cli-service electron:serve",
"postinstall": "electron-builder install-app-deps",
"postuninstall": "electron-builder install-app-deps"
},
...
}
Could someone please help me locate the issue and provide guidance on resolving it?