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

Fix fs.promises ExperimentalWarning on Node 10.1.0 #578

Merged
merged 1 commit into from May 9, 2018
Merged

Fix fs.promises ExperimentalWarning on Node 10.1.0 #578

merged 1 commit into from May 9, 2018

Conversation

bajtos
Copy link
Contributor

@bajtos bajtos commented May 9, 2018

Fixes #577

When fs-extra is loaded on Node.js 10.1.0, an experimental warning is printed:

(node:7885) ExperimentalWarning: The fs.promises API is experimental

This pull request fixes the problem by defining fs.promises as a getter property.

@RyanZim @jprichardson could you please take a look?

@coveralls
Copy link

coveralls commented May 9, 2018

Coverage Status

Coverage decreased (-0.2%) to 86.826% when pulling c47822e on bajtos:fix-experimental-warning into 7d36349 on jprichardson:master.

Copy link
Collaborator

@JPeer264 JPeer264 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think, we should remove that as soon as the warning is gone in the Node core. Thoughts?

@RyanZim
Copy link
Collaborator

RyanZim commented May 9, 2018

@JPeer264 Agreed, but we might still need to keep it for quite awhile, especially if all versions of Node 10 have it.

@bajtos
Copy link
Contributor Author

bajtos commented May 9, 2018

I think, we should remove that as soon as the warning is gone in the Node core. Thoughts?

As a consumer of fs-extra, I am happy with removing this workaround as soon as the latest Node.js 10.x version does not print the warning.

@RyanZim RyanZim merged commit 2ffb64c into jprichardson:master May 9, 2018
@bajtos bajtos deleted the fix-experimental-warning branch May 10, 2018 06:30
@bajtos
Copy link
Contributor Author

bajtos commented May 10, 2018

Thank you for landing and publishing my fix so quickly! ❤️ 🎉

@wangjianjun0730
Copy link

What dose it mean?And what can I do to remove this warning? The version of my node is v10.1.0.

@JPeer264
Copy link
Collaborator

@wangjianjun0730 this warning is due to the change from fs/promise to fs.promise. We suppressed this warning in fs-extra@6.0.1.

@archervallesfin
Copy link

Still having problem in my side still showing the warning.
node

@JPeer264
Copy link
Collaborator

You are correct critical is directly using 6.0.1. But there is another dependency, asset-resolver, which is using the version 5.0.0, I think that is causing the warning: https://github.com/addyosmani/critical/blob/master/package-lock.json#L203

@bajtos
Copy link
Contributor Author

bajtos commented May 15, 2018

Because there are so many packages depending on fs-extra, I think it's pretty much impossible to get them all to upgrade fs-extra 6.x to receive the fix. I think our best option is to wait until Node.js releases the fix - see nodejs/node#20504

In loopback-next, we temporarily pinned down the Node.js version to 10.0.0 in our CI configuration to avoid the experimental warning triggered by our deep fs-extra dependencies.

@billtlee
Copy link

Hi, I just upgraded to 6.0.1 running node 10.1.0. The experimental warning went away, but the functions is not doing anything. For example

const buildPath = path.resolve(__dirname, 'build');
fs.removeSync(buildPath);

is not deleting my build directory. Is there a work around for now? I am using this to compile my files. Thanks!

@RyanZim
Copy link
Collaborator

RyanZim commented May 21, 2018

@billtlee Please open a new issue with a reduced test case.

Repository owner locked as resolved and limited conversation to collaborators May 21, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ExperimentalWarning: The fs.promises API is experimental (Node.js 10.1.0)
8 participants