Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

os.tmpDir() is deprecated - node and formidable

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?

like image 969
Fluffy Avatar asked Dec 01 '16 14:12

Fluffy


1 Answers

@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;

like image 55
Luis Roberto Avatar answered Oct 24 '22 02:10

Luis Roberto