I use node version 7.2.0 and formidable version 1.0.17 for file upload. After updating to the node version 7.2.0 I now get the following error when uploading files:
(node:3376) DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
I don't use the default of form.uploadDir
but some custom path.
How would I fix that error?
Luis Roberto
@idbehold, it worked like a charm.
It's not really an error, it's a deprecation warning. You can ask the formidable maintainers to fix it or you could just put something like the following at the top of your file:
var os = require('os');
os.tmpDir = os.tmpdir;
来源:https://stackoverflow.com/questions/40913034/os-tmpdir-is-deprecated-node-and-formidable