octalmage / robotjs

Node.js Desktop Automation.
http://robotjs.io
MIT License
12.37k stars 961 forks source link

webpack error NODE_MODULE_VERSION #564

Open CrimsonVex opened 4 years ago

CrimsonVex commented 4 years ago

Attempting to call npm start for my node app that uses robotjs 0.6.0 installed via npm install robotjs on node 12.16.1 under Windows 10 Pro x64.

I've got node-gyp installed, and running node-gyp rebuild in the node_modules/robotjs folder of my project runs successfully.

Current Behavior

Error: The module '\\?\C:\Users\user\Documents\project\dist\robotjs-2c1c75d03e1bba544a630b30a411799b.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 72. This version of Node.js requires
NODE_MODULE_VERSION 79. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1201:18)
    at Module.load (internal/modules/cjs/loader.js:1000:32)
    at Function.Module._load (internal/modules/cjs/loader.js:899:14)
    at Module.require (internal/modules/cjs/loader.js:1040:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at eval (webpack:///./node_modules/robotjs/build/Release/robotjs.node?:1:18)
    at Object../node_modules/robotjs/build/Release/robotjs.node (C:\Users\aecbo\Documents\artemis\dist\index.js:3522:1)
    at __webpack_require__ (C:\Users\user\Documents\project\dist\index.js:20:30)
    at eval (webpack:///./node_modules/robotjs/index.js?:1:15)
    at Object../node_modules/robotjs/index.js (C:\Users\user\Documents\project\dist\index.js:3533:1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1

Your Environment

thephucit commented 4 years ago

Same problem.

JeffreyDavidsz commented 4 years ago

In the site there is a small explanation about building on windows. Although that did not have me a good result, after that and after using electron-rebuild (extra nom package), it started to work for me