You can install prebuild binary for node-pty by installing this node package:
Requirement: nodejs18 LTS
npm install node-pty-prebuilt-multiarch
after installing:
Replace
import pty from 'node-pty';
With
import pty from 'node-pty-prebuilt-multiarch';