os.tmpDir() is deprecated - node and formidable
Asked Answered
L

1

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?

Labors answered 1/12, 2016 at 14:21 Comment(3)
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;Pasco
@idbhold: Many thanks. That worked!Labors
@idbhold, thanks. Don't know why the warning is shown as an error.Kibitz
M
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;

Malvoisie answered 17/11, 2017 at 20:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.