Closed childrentime closed 2 years ago
btw, window build tools seems to no need to install
@childrentime the build tools only need to be installed if you don't have the right tool chain installed.
You want import * as pty from 'node-pty'
, that's the equivalent to var pty = require('node-pty')
on the readme.
node.js latest version has window build tools built in. and what my point is, when i use import instead of require, it will throw runtime error
@childrentime a runtime error is expected though, if TS is configured correctly you should see an error as well:
Oooooh. My mistake. Thanks❤️❤️❤️! I just used to default export😅.
Environment details
Issue description
when i use ts-node and typescript
import pty from 'node-pty';
it will throw error
TypeError: Cannot read property 'spawn' of undefined';
and when i change to
const pty = require('node-pty');
it works