Skip to content

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

Closed
@rpatrick00

Description

@rpatrick00

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions