When using the fs.rmdir function I get this error from Ubuntu:
fs.js:136
throw new ERR_INVALID_CALLBACK();
^
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at makeCallback (fs.js:136:11)
at Object.rmdir (fs.js:671:14)
<...>
I'm not sure what the cause of this is, since it works perfectly fine when I test it locally on my Windows 10 computer.
Here's the code that is causing the error:
// remove client's temporary directory and its files
fs.rmdir('temp/' + socketID, {recursive: true}, (error) => {
if(error) throw error;
});
Also, on the Ubuntu machine, if I remove the {recursive: true} option, the command does run and the callback works, but it doesn't solve the problem since I want the recursive option.