execa: Error: Premature close
async function run()
{
const { execa } = await import('execa');
await execa({
stdout: {
file: "out.txt",
}
})`npm run tsc`;
}
run();
"tsc": "rimraf ./dist/ && tsc --p tsconfig.json"
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 23
Node 22 did include a few bug fixes related to streams, so this must have been the problem. Thanks for sharing the solution!
I currently use ts-node and cjs to run typescript code. The code above is esm. I’m afraid I need to configure my project. Wait for me to configure it.