node-pty icon indicating copy to clipboard operation
node-pty copied to clipboard

Wrong Node Module Version

Open ibaraki-douji opened this issue 1 year ago • 1 comments
trafficstars

Environment details

  • OS: Ubuntu
  • OS version: 22.04
  • node-pty version: 1.0.0

Issue description

After installing node-pty, i tried to spawn a command and this error triggered. image

As proposed i tried npm rebuild and npm install but with no success

ibaraki-douji avatar Jul 09 '24 09:07 ibaraki-douji

+1

LotsoTeddy avatar Jul 30 '24 03:07 LotsoTeddy

Same problem on Windows 11 (23H2) with the same node-pty version:

(node:31732) UnhandledPromiseRejectionWarning: Error: The module '\\?\D:\Projects\Apps\Temp\Test\test\node_modules\node-pty\build\Release\conpty.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 115. This version of Node.js requires
NODE_MODULE_VERSION 128. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).

Recompiling/reinstalling the module, or downgrading to various node and electron versions does not resolve the issue either. Is there any plan to address this?

navid-m avatar Sep 25 '24 10:09 navid-m

This happens typically when you've installed/compiled node-pty using your local node's version and then try to run it in Electron. I'm not sure if this is still the right way to do it, but that's what this file does:

https://github.com/microsoft/node-pty/blob/main/examples/electron/npm_install.sh

Please consult Electron or your platform's docs on this.

Tyriar avatar Sep 26 '24 14:09 Tyriar