You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.close (fs.js:394:20)
at Object.[close] (/home/dev/repo/node_modules/tar/lib/write-entry.js:225:8)
at Object.[onread] (/home/dev/repo/node_modules/tar/lib/write-entry.js:243:18)
at fs.read (/home/dev/repo/node_modules/tar/lib/write-entry.js:220:19)
at FSReqWrap.wrapper [as oncomplete] (fs.js:467:17)
We're using tar v4.4.11. This error occurs when executing a tar.create() function on Ubuntu (Node v10.16.1) , but not on Windows (Node v12.4).
I think the issue is with the second parameter to the fs.close() function. Since Node v10 a callback is required as the second parameter.
I'm not sure how Node API changes are handled within this library so I can't send some code. I think there either needs to be code to check the Node version and act appropriately, or a specific version needs to be used as the default (ie. the latest one where the callback is required.)
The text was updated successfully, but these errors were encountered:
EmGustave
changed the title
fs.close() callback not provided.
fs.close() callback not provided in write-entry.js.
Sep 23, 2019
Yeah, that's definitely an issue. I was scratching my head because I could've sworn I'd fixed this, but it turns out I'd only fixed it on the v5 branch :)
I started seeing this error today:
We're using tar v4.4.11. This error occurs when executing a tar.create() function on Ubuntu (Node v10.16.1) , but not on Windows (Node v12.4).
I think the issue is with the second parameter to the fs.close() function. Since Node v10 a callback is required as the second parameter.
In the lib/write-entry.js, that callback is not always provided. It's provided here:
https://github.com/npm/node-tar/blob/9232b3d7da934c142e3d0ab97ef35ec0ba3917fc/lib/write-entry.js#L219
and here:
https://github.com/npm/node-tar/blob/9232b3d7da934c142e3d0ab97ef35ec0ba3917fc/lib/write-entry.js#L269
But not here:
https://github.com/npm/node-tar/blob/9232b3d7da934c142e3d0ab97ef35ec0ba3917fc/lib/write-entry.js#L234
nor here:
https://github.com/npm/node-tar/blob/9232b3d7da934c142e3d0ab97ef35ec0ba3917fc/lib/write-entry.js#L243
I'm not sure how Node API changes are handled within this library so I can't send some code. I think there either needs to be code to check the Node version and act appropriately, or a specific version needs to be used as the default (ie. the latest one where the callback is required.)
The text was updated successfully, but these errors were encountered: