sindresorhus/opn

Do you want to work on this issue?

You can request for a bounty in order to promote it!

Older Node 18 versions do not provide a `constants` export #341

mkilpatrick posted onGitHub

Using Node 18.0.0 results in this error after upgrading from 9.x to 10.x.

import fs, {constants as fsConstants} from 'node:fs/promises';
            ^^^^^^^^^
SyntaxError: The requested module 'node:fs/promises' does not provide an export named 'constants'

It's an error until you use >= v18.4.0


i got same problem in node v14, but node v16 and v18 no problem

posted by wujingquan 11 months ago

node14x: <img width="1027" alt="image" src="https://github.com/user-attachments/assets/d9c8d300-8d9b-4467-b0ec-230a1bfdd0c3">

node18: <img width="965" alt="image" src="https://github.com/user-attachments/assets/70aa75c3-0e75-4403-bb73-4ff52b8cb357">

posted by luckfunc 8 months ago

Fund this Issue

$0.00
Funded
Only logged in users can fund an issue

Pull requests