[refactor] Replace deprecated constants (#3789)

`fs.F_OK` and `fs.R_OK` are [deprecated since a while node
20.8.0](https://nodejs.org/api/deprecations.html#DEP0176).

Node 24 now complains about them when running server mode (`node --run
server`):

```bash
[2025-05-23 23:11:44.932] [ERROR] (node:37733) [DEP0176] DeprecationWarning: fs.F_OK is deprecated, use fs.constants.F_OK instead
(Use `node --trace-deprecation ...` to show where the warning was created) 
```

The replacements have been in place for a while, and this change should
work without any issues.
This commit is contained in:
Kristjan ESPERANTO
2025-05-23 23:57:50 +02:00
committed by GitHub
parent 4e3821c2ff
commit 85b4ece767
3 changed files with 8 additions and 7 deletions

View File

@@ -35,7 +35,7 @@ function checkConfigFile () {
// Check permission
try {
fs.accessSync(configFileName, fs.F_OK);
fs.accessSync(configFileName, fs.constants.F_OK);
} catch (error) {
throw new Error(`${error}\nNo permission to access config file!`);
}