os.tmpDir() is deprecated - node and formidable

左心房为你撑大大i 提交于 2019-12-04 10:45:33

问题


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?


回答1:


@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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!