Skip to content

fs: fsPromises.lchmod throws AssertionError on Ubuntu #21421

Description

@shisama
  • Version: v11.0.0-pre
  • Platform: Linux bf7762b084bb 4.9.87-linuxkit-aufs deps: update openssl to 1.0.1j #1 SMP Wed Mar 14 15:12:16 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem: fs

When I run the below code on Ubuntu 18.04 on Docker, I got the error.
Expected behavior was Error [ERR_METHOD_NOT_IMPLEMENTED] but I got AssertionError [ERR_ASSERTION].

const fs = require('fs');
const { lchmod } = fs.promises;

(async () => {
  try {
    await lchmod('./test.txt', 0o777);
  } catch (err) {
    console.log(err);
  }
})();
 { AssertionError [ERR_ASSERTION]: Code: ERR_METHOD_NOT_IMPLEMENTED; The provided arguments length (0) does not match the required ones (1).
    at getMessage (internal/errors.js:223:3)
    at new NodeError (internal/errors.js:156:13)
    at lchmod (internal/fs/promises.js:373:11)
    at repl:3:10
    at repl:7:3
    at Script.runInThisContext (vm.js:89:20)
    at REPLServer.defaultEval (repl.js:317:29)
    at bound (domain.js:396:14)
    at REPLServer.runBound [as eval] (domain.js:409:12)
    at REPLServer.onLine (repl.js:615:10)
  generatedMessage: false,
  name: 'AssertionError [ERR_ASSERTION]',
  code: 'ERR_ASSERTION',
  actual: false,
  expected: true,
  operator: '==' }

Does ERR_METHOD_NOT_IMPLEMENTED() require arguments like ERR_METHOD_NOT_IMPLEMENTED('lchmod()')?

https://github.com/nodejs/node/blob/master/lib/internal/fs/promises.js#L373
https://github.com/nodejs/node/blob/master/lib/internal/fs/promises.js#L381

Metadata

Metadata

Assignees

No one assigned

    Labels

    errorsIssues and PRs related to JavaScript errors originating in Node.js core.experimentalIssues and PRs related to experimental features.fsIssues and PRs related to file-system APIs and the fs module.promisesIssues and PRs related to ECMAScript promises.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions