Skip to content

Commit

Permalink
fix: correct import of 'constants' from 'node:fs' for Node.js 14 comp…
Browse files Browse the repository at this point in the history
…atibility

In Node.js 14, 'fs/promises' does not export 'constants'.
This change ensures 'constants' is imported directly from 'node:fs' for compatibility with Node.js 14.
  • Loading branch information
luckfunc committed Sep 8, 2024
1 parent 2ea66da commit ec77a12
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import {Buffer} from 'node:buffer';
import path from 'node:path';
import {fileURLToPath} from 'node:url';
import childProcess from 'node:child_process';
import fs, {constants as fsConstants} from 'node:fs/promises';
import fs from 'node:fs/promises';
import {constants as fsConstants} from 'node:fs';
import isWsl from 'is-wsl';
import defineLazyProperty from 'define-lazy-prop';
import defaultBrowser from 'default-browser';
Expand Down

0 comments on commit ec77a12

Please sign in to comment.