![]() Add electron-rebuild to your project's package.json's install hookįor an example project, check out electron-serialport. ![]() npm install -save-dev electron-rebuild.To recompile serialport (or any native Node.js module) for Electron, you can use electron-rebuild more info at Electron's README. When you first install serialport it will compile against the version of Node.js on your machine, not against the Node.js runtime bundled with Electron. If you require serialport as a dependency for an Electron project, you must compile it for the version of Electron your project's using. It comes with its own version of the Node.js runtime. # If you're installing as root, you'll also need to use the -unsafe-perm flagĮlectron is a framework for creating cross-platform desktop applications. Npm install serialport -build-from-source # Then we can install serialport, forcing it to compile Sudo apk add -no-cache make gcc g++ python linux-headers udev # Add the necessary build and runtime dependencies # If you don't have node/npm already, add that first
0 Comments
Leave a Reply. |