我是 Node.js 新手,在我的项目中,我在本地(macOS 上 Node.js 版本为 9.10.1
)和服务器(Ubuntu 上 Node.js 版本为 10.6.0
)中运行它
在本地,一切运行良好,但在服务器中,当我运行 node app.js
时,我会收到以下错误
(node:17488) [DEP0095] DeprecationWarning: timers.enroll() is
deprecated. Please use setTimeout instead.
(node:17488) [DEP0096] DeprecationWarning: timers.unenroll() is
deprecated. Please use clearTimeout instead.
app runs on port 3000
如何找到问题所在?非常感谢。
最佳答案
只需使用 setTimeout
和 clearTimeout
而不是 timers.enroll
和 timers.unenroll
。
关于javascript - 无法理解 Node.js 中的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51337815/