node.jsinstallationnode-pty

fail to install node-pty library


I'm trying to add node-pty. Set as the following in the package.json file "node-pty": "^0.10.1" (it's a 3 years old project) but it's returning the error when I run the yarn install command:

    error C:\Users\neto\Desktop\testes\newton\node_modules\node-pty: Command failed.
Exit code: 1
Command: node scripts/install.js
Arguments:
Directory: C:\Users\neto\Desktop\testes\newton\node_modules\node-pty
Output:
node:internal/child_process:421
    throw new ErrnoException(err, 'spawn');
    ^

Error: spawn EINVAL
    at ChildProcess.spawn (node:internal/child_process:421:11)
    at spawn (node:child_process:763:9)
    at Object.<anonymous> (C:\Users\neto\Desktop\testes\newton\node_modules\node-pty\scripts\install.js:11:20)
    at Module._compile (node:internal/modules/cjs/loader:1692:14)
    at Object..js (node:internal/modules/cjs/loader:1824:10)
    at Module.load (node:internal/modules/cjs/loader:1427:32)
    at Module._load (node:internal/modules/cjs/loader:1250:12)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:152:5) {
  errno: -4071,
  code: 'EINVAL',
  syscall: 'spawn'

I've tried add a recenet version, it result in even more errors. I have no idea how to fix that. The issue is with node-pty, if I remove this, yarn ran fine.


Solution

  • I did downgrade to node 20.12.1, as @ Sebastian Kaczmarek mentioned and it worked