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

fs.promises is undefined #69

Open
MartinKavik opened this issue Oct 9, 2019 · 8 comments · May be fixed by #70
Open

fs.promises is undefined #69

MartinKavik opened this issue Oct 9, 2019 · 8 comments · May be fixed by #70

Comments

@MartinKavik
Copy link

Hi,

fs.promises is undefined on some platforms (at least on NixOS). I wasn't able to track down exact problem, but it seems that webpack is doing some magic with fs.
And I think we shouldn't use APIs which are flagged as experimental in Node.js LTS version (like fs.promises) because they can (indirectly) cause problems.

I suggest to replace

return fs.promises.stat(this.crateDirectory).then(stats => {

with

const stat = util.promisify(fs.stat);
...
return stat(this.crateDirectory).then(stats => {

I'll create PR.


Platform details:

  • node v10.15.3
  • npm 6.4.1
  • yarn 1.13.0
  • nixos 19.03
@rbtcollins
Copy link

rbtcollins commented Oct 10, 2019

I hit this with

$ node --version
v8.10.0

@MartinKavik
Copy link
Author

MartinKavik commented Oct 10, 2019

@rbtcollins fs.promises is available on Node v10+. So yes, it can be another reason to not use it.

@mcobzarenco
Copy link

Having the same problem with node v8.16.2

@Herschel
Copy link

Same problem here

@vuuk
Copy link

vuuk commented Mar 22, 2020

Had the same problem, adding the code from the PR fixed the issue. Thank you.

@Herlix
Copy link

Herlix commented Apr 27, 2020

Hi!

I'm having the same problem with this. Is there a plan to add a PR for it?

@MartinKavik
Copy link
Author

@Herlix Old PR exists, see referenced items above ^

@shaliniBunga21
Copy link

HI! everyone,
I'm having the same problem with Node version v16.13.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants