Skip to content

Commit f35407a

Browse files
authored
Support Node 16 on CLI (#53)
* Support Node 16 * Changeset * Revert types change, v20 needed for tests
1 parent ccb3547 commit f35407a

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

.changeset/curly-cougars-sleep.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@arethetypeswrong/cli": patch
3+
---
4+
5+
Fix crash on Node <v17

package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/cli/src/index.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { readFile, stat, unlink } from "fs/promises";
1010
import { createRequire } from "module";
1111
import { FetchError } from "node-fetch";
1212
import path from "path";
13-
import readline from "readline/promises";
13+
import readline from "readline";
1414
import { problemFlags } from "./problemUtils.js";
1515
import { readConfig } from "./readConfig.js";
1616
import * as render from "./render/index.js";
@@ -118,7 +118,9 @@ particularly ESM-related module resolution issues.`
118118
);
119119
}
120120
const rl = readline.createInterface(process.stdin, process.stdout);
121-
const answer = await rl.question(`Run \`npm pack\`? (Pass -P/--pack to skip) (Y/n) `);
121+
const answer = await new Promise<string>((resolve) => {
122+
rl.question(`Run \`npm pack\`? (Pass -P/--pack to skip) (Y/n) `, resolve);
123+
});
122124
rl.close();
123125
if (answer.trim() && !answer.trim().toLowerCase().startsWith("y")) {
124126
process.exit(1);

0 commit comments

Comments
 (0)