当我打开页面后立即启动 http-server 时,我得到:
node:25611) [DEP0066] DeprecationWarning: OutgoingMessage.prototype._headers is deprecated
(Use `node --trace-deprecation ...` to show where the warning was created)
有人可以提供以下方面的具体说明:
- 如何(使用
node --trace-deprecation ...
显示警告的创建位置) - 如何解决问题
最佳答案
http-server
Github 上有一个 Unresolved 问题 ( #537 )。简而言之,这甚至不是包本身的问题,而是其依赖项之一的问题。这里有一个要点:
This is an issue in union (flatiron/union#64) which we're planning to remove from http-server down the road (#483). I'm not going to close this issue though, to ensure we make sure it goes away after #483 is resolved.
虽然这是大约一年前(2019 年 10 月 24 日)写的,但本期和前面提到的 #483还活着,还在踢。因此,除非您确实希望降级到 Node 10,否则您必须忽略该警告。
关于httpserver - http-server 给出警告消息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64326181/