-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Importing fs constants in node:fs/promises throws an error #45234
Comments
What is the error that is thrown? |
It works fine for me in Node.js 18 and 19. What version are you using? |
Works in Node.js 16 as well. It does not work in Node.js 14 but the documentation for 14.x doesn't include that, so it seems like all supported releases are working as expected. |
must be the version, I was under the impression I defaulted 19 just before that, but apparently I am still on 17..
C:>node -v |
Yeah, 17.x doesn't work with this. 17.x is also no longer supported as of about 5 months ago. So, yeah, try updating to 18.x and it should work. |
Pinging @nodejs/version-management in case anyone wants to offer suggestions or try to troubleshoot @kapekost's possible issue with nvm for Windows. |
@kapekost - please see coreybutler/nvm-windows#708. For anyone landing here from Google, NVM4W 1.1.8 and below requires the full version, i.e. |
Thanks! Looks lime the older NVM version on windows, was reporting a successful switch to nodejs 19, and it was digesting a permission error. It worked ok after upgrading that to latest, and run as admin |
Affected URL(s)
https://nodejs.org/api/fs.html#fspromisesaccesspath-mode
Description of the problem
the above
constants
seems to be badly exported. As a workaround one can import* from 'node/fs
The text was updated successfully, but these errors were encountered: