Skip to content
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

Update fs.md #35740

Closed
muzhaqi16 opened this issue Oct 21, 2020 · 1 comment
Closed

Update fs.md #35740

muzhaqi16 opened this issue Oct 21, 2020 · 1 comment
Labels
fs Issues and PRs related to the fs subsystem / file system.

Comments

@muzhaqi16
Copy link

I thought it was the same thing as well but unfortunately when I use require('fs/promises') I do receive an error message on my node environment but not if I use the second option.

Error: Cannot find module 'fs/promises'
Require stack:

My node version is v12.18.3

Originally posted by @muzhaqi16 in #35726 (comment)

@aduh95
Copy link
Contributor

aduh95 commented Oct 21, 2020

The current documentation is only true for Node.js 14+. For Node.js 12, please check out https://nodejs.org/docs/latest-v12.x/api/fs.html#fs_fs_promises_api

For info, here is the support table for those features:

Node.js version range require('fs/promises') require('fs').promises
v10.0.0
≥v10.1.0 <14.0.0
≥14.0.0

Maybe we could add an history section in the docs to clarify what support users can expect.

aduh95 added a commit to aduh95/node that referenced this issue Oct 21, 2020
@PoojaDurgad PoojaDurgad added the fs Issues and PRs related to the fs subsystem / file system. label Oct 22, 2020
ExE-Boss added a commit to ExE-Boss/node that referenced this issue Oct 24, 2020
Fixes: nodejs#35740

Refs: nodejs#31553
Refs: nodejs#32953
Refs: nodejs#33991
Refs: nodejs#34001
Refs: nodejs#34055
Refs: nodejs#34962

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Rich Trott <rtrott@gmail.com>
MylesBorins pushed a commit that referenced this issue Nov 3, 2020
#34843 was cherry-picked onto
`v12.x-staging` in 961844d but the `fs/promises` API, as used
in the examples, is only available from Node.js 14. Change the
added examples to use `require(fs).promises` instead.

PR-URL: #35760
Fixes: #35740
Refs: #34843
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
targos pushed a commit that referenced this issue Nov 3, 2020
Fixes: #35740

Refs: #31553
Refs: #32953
Refs: #33991
Refs: #34001
Refs: #34055
Refs: #34962

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Rich Trott <rtrott@gmail.com>

PR-URL: #34002
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
MylesBorins pushed a commit that referenced this issue Nov 16, 2020
#34843 was cherry-picked onto
`v12.x-staging` in 961844d but the `fs/promises` API, as used
in the examples, is only available from Node.js 14. Change the
added examples to use `require(fs).promises` instead.

PR-URL: #35760
Fixes: #35740
Refs: #34843
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
Reviewed-By: Michaël Zasso <targos@protonmail.com>
Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com>
targos pushed a commit that referenced this issue May 16, 2021
Fixes: #35740

Refs: #31553
Refs: #32953
Refs: #33991
Refs: #34001
Refs: #34055
Refs: #34962

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Rich Trott <rtrott@gmail.com>

PR-URL: #34002
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
targos pushed a commit that referenced this issue Jun 11, 2021
Fixes: #35740

Refs: #31553
Refs: #32953
Refs: #33991
Refs: #34001
Refs: #34055
Refs: #34962

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Trivikram Kamat <trivikr.dev@gmail.com>
Co-authored-by: Rich Trott <rtrott@gmail.com>

PR-URL: #34002
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Masashi Hirano <shisama07@gmail.com>
Reviewed-By: Pranshu Srivastava <rexagod@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
GaryB432 added a commit to GaryB432/gb-lerna that referenced this issue Nov 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fs Issues and PRs related to the fs subsystem / file system.
Projects
None yet
3 participants