0

I'm working on a little Electron.js app. I want to get information about active window so I came across npm package active-win. I get it working at Linux and OSx without problem, but on Windows I get version error.

UnhandledPromiseRejectionWarning: Error: The module '\\?\C:\...\git\in_sane_factory\desktop-app\node_modules\iconv\build\Release\iconv.node'was compiled against a different Node.js version using
NODE_MODULE_VERSION 108. This version of Node.js requires
NODE_MODULE_VERSION 106. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

The iconv package is needed for active-win in version above 2. Highest version and default to install is 2.3.5. Only other version that I manage to install was 2.3.4 and that did not solve anything. I tried to npm install, npm rebuild, cloning iconv repository and installing this version manualy via npm install <path>. I tried to install the right version of Node.js but by official version table, there is no version 106. I only manage to upgrade from 93 to 108.

I'm not really skilled Node.js user and now I'm trully hopeless. Do you have any advice or idea, what may solve this?

Sources:

JJ_0
  • 11
  • 3
  • You can try this one https://stackoverflow.com/questions/74238717/compiled-against-a-different-node-js-version-using-node-module-version/74241648#74241648 – Mustafa Demiraslan Nov 01 '22 at 21:38
  • ABI version 106 probably means you're using Node from Electron. Refer to this table: https://github.com/electron/releases#releases – Boris Verkhovskiy Dec 02 '22 at 17:45

2 Answers2

1

Node.js version or version of package was not the issue in the end. After a few weeks I found out, where I was wrong. All needed to fix it was installing electron-rebuild and then running simple .\node_modules\.bin\electron-rebuild.cmd. Hope, if you come across similar problem, this can help you as well.

JJ_0
  • 11
  • 3
-1

I think you are basically running a different nodejs version on your windows machine. Cross check with the version on your Mac to confirm.