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

Node.js deprecation warning DEP0147: fs.rmdir(path, { recursive: true }) #1198

Closed
rak-phillip opened this issue Jan 6, 2022 · 0 comments · Fixed by #1199
Closed

Node.js deprecation warning DEP0147: fs.rmdir(path, { recursive: true }) #1198

rak-phillip opened this issue Jan 6, 2022 · 0 comments · Fixed by #1199
Assignees
Labels
kind/bug Something isn't working
Milestone

Comments

@rak-phillip
Copy link
Contributor

rak-phillip commented Jan 6, 2022

Rancher Desktop Version

0.7.1

Rancher Desktop K8s Version

NA

What operating system are you using?

macOS

Operating System / Build Version

NA

What CPU architecture are you using?

x64

Windows User Only

No response

Actual Behavior

Deprecation error for DEP0147: fs.rmdir(path, { recursive: true }) is printed to console when running for dev.

Steps to Reproduce

Fetch latest version of Rancher Desktop for development
Run for development
Review console output

Result

Deprecation warning is printed to console

In future versions of Node.js, recursive option will be ignored for fs.rmdir, fs.rmdirSync, and fs.promises.rmdir.

Use fs.rm(path, { recursive: true, force: true }), fs.rmSync(path, { recursive: true, force: true }) or fs.promises.rm(path, { recursive: true, force: true }) instead.

Expected Behavior

Deprecation warning does not appear

Additional Information

It looks like the deprecated usage of rmdir is used in several locations:

  • src/config/settings.ts
  • src/k8s-engine/__tests__k3sHelper.spec.ts
  • src/k8s-engine/k3sHelper.ts
  • src/k8s-engine/lima.ts
  • src/k8s-engine/wsl.ts
  • src/utils/safeRename.ts

https://nodejs.org/api/deprecations.html#dep0147-fsrmdirpath--recursive-true-

@rak-phillip rak-phillip added the kind/bug Something isn't working label Jan 6, 2022
@jandubois jandubois added this to the v1.0.0-beta milestone Jan 6, 2022
@rak-phillip rak-phillip self-assigned this Jan 6, 2022
mook-as added a commit to mook-as/rd that referenced this issue Jan 11, 2022
We're now using NodeJS 16 to build things; we should update the TypeScript
definition to match.  This could have helped with rancher-sandbox#1198.

Signed-off-by: Mark Yen <mark.yen@suse.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants