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

fix:Callback must be a function when use fs.unlink in node.js v7.0+ #84

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

yilihjy
Copy link

@yilihjy yilihjy commented Dec 20, 2018

Since node v7.0.0, when use fs.unlink(path, callback) ,the callback parameter is no longer optional.

Like use in node v10.14.2

fs.js:137
    throw new ERR_INVALID_CALLBACK();
    ^

TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
    at makeCallback (fs.js:137:11)
    at Object.unlink (fs.js:936:14)
    at ReadStream.<anonymous> (xxxxxxxxxxx\node_modules\jquery-file-upload-middleware\lib\uploadhandler.js:149:48)
    at ReadStream.emit (events.js:187:15)
    at endReadableNT (_stream_readable.js:1094:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

so i add some function(){} as the callback parameter,then the code run well.

@WebMasterSam
Copy link

Same issue here... :-(

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

Successfully merging this pull request may close these issues.

2 participants