13

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?

Bruno Bieri
  • 9,724
  • 11
  • 63
  • 92
Fluffy
  • 217
  • 1
  • 2
  • 9
  • 20
    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;` – idbehold Dec 01 '16 at 16:16
  • @idbhold: Many thanks. That worked! – Fluffy Dec 01 '16 at 17:31
  • @idbhold, thanks. Don't know why the warning is shown as an error. – A. Hada Nov 12 '19 at 17:00

1 Answers1

16

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

Bruno Bieri
  • 9,724
  • 11
  • 63
  • 92
Luis Roberto
  • 375
  • 4
  • 10