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

fsPromises.rm() not a function on Linux (works fine on MacOS and Windows)? #37972

Closed
rpatrick00 opened this issue Mar 29, 2021 · 1 comment
Closed

Comments

@rpatrick00
Copy link

rpatrick00 commented Mar 29, 2021

What steps will reproduce the bug?

  1. On MacOS or Windows, do the following:
  1. On Linux, do the same steps and see the error.
[rpatrick@rpatrick-1 promises-rm-bug]$ node index.js deleteMe.txt
Attempting to delete deleteMe.txt
TypeError: fsPromises.rm is not a function
    at /scratch/rpatrick/promises-rm-bug/index.js:12:16
    at new Promise (<anonymous>)
    at main (/scratch/rpatrick/promises-rm-bug/index.js:11:10)
    at Object.<anonymous> (/scratch/rpatrick/promises-rm-bug/index.js:34:1)
    at Module._compile (internal/modules/cjs/loader.js:1236:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)
    at Module.load (internal/modules/cjs/loader.js:1085:32)
    at Function.Module._load (internal/modules/cjs/loader.js:950:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47
[rpatrick@rpatrick-1 promises-rm-bug]$ 

How often does it reproduce? Is there a required condition?

It works fine on MacOS and Windows but fails on Linux every time.

What is the expected behavior?

I expect for fsPromises.rm to be a function on Linux, just as it is on Windows and MacOS.

What do you see instead?

TypeError: fsPromises.rm is not a function

Additional information

[rpatrick@rpatrick-1 promises-rm-bug]$ node index.js deleteMe.txt
Attempting to delete deleteMe.txt
TypeError: fsPromises.rm is not a function
    at /scratch/rpatrick/promises-rm-bug/index.js:12:16
    at new Promise (<anonymous>)
    at main (/scratch/rpatrick/promises-rm-bug/index.js:11:10)
    at Object.<anonymous> (/scratch/rpatrick/promises-rm-bug/index.js:34:1)
    at Module._compile (internal/modules/cjs/loader.js:1236:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1257:10)
    at Module.load (internal/modules/cjs/loader.js:1085:32)
    at Function.Module._load (internal/modules/cjs/loader.js:950:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
    at internal/main/run_main_module.js:17:47
[rpatrick@rpatrick-1 promises-rm-bug]$ 

On Linux, I installed node.js from https://nodejs.org/dist/v14.6.0/node-v14.6.0-linux-x64.tar.gz.

@rpatrick00
Copy link
Author

14.16.0 seems to resolve the issue.

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

No branches or pull requests

1 participant