Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Callback must be a function fs.mkdir index.js @ 50 #89

Open
moorthi07 opened this issue Feb 18, 2019 · 0 comments
Open

Callback must be a function fs.mkdir index.js @ 50 #89

moorthi07 opened this issue Feb 18, 2019 · 0 comments

Comments

@moorthi07
Copy link

moorthi07 commented Feb 18, 2019

Error:
$node server.js
uncaughtException
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at makeCallback (fs.js:135:11)
at Object.mkdir (fs.js:711:16)
at new Fileupload
node_modules\dpd-fileupload\index.js:50:12)

Current Code: at line no. 88 in index.js
// If the directory doesn't exists, we'll create it
try {
fs.statSync(this.config.fullDirectory).isDirectory();
} catch (er) {
fs.mkdir(this.config.fullDirectory);
}

fs.mkdir(this.config.fullDirectory); - need to add a callback to handle error.

FiX:
// If the directory doesn't exists, we'll create it
try {
fs.statSync(this.config.fullDirectory).isDirectory();
} catch (er) {
fs.mkdir(this.config.fullDirectory,```
function(err) {
if (err) {}}

    }
ezra-obiwale added a commit to ezra-obiwale/dpd-fileupload that referenced this issue Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant