Repository navigation
fs: fsPromises.lchmod throws AssertionError on Ubuntu #21421
Copy link
Copy link
Closed
Labels
errorsIssues and PRs related to JavaScript errors originating in Node.js core.Issues and PRs related to JavaScript errors originating in Node.js core.experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.
Description
- 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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
errorsIssues and PRs related to JavaScript errors originating in Node.js core.Issues and PRs related to JavaScript errors originating in Node.js core.experimentalIssues and PRs related to experimental features.Issues and PRs related to experimental features.fsIssues and PRs related to file-system APIs and the fs module.Issues and PRs related to file-system APIs and the fs module.promisesIssues and PRs related to ECMAScript promises.Issues and PRs related to ECMAScript promises.
Activity
cjihrig commentedon Jun 20, 2018
Care to send a PR for both lchmod and lchown?
shisama commentedon Jun 20, 2018
@cjihrig
Thank you for your reply. I'll send it.
test: add test for error codes doc and impl