我正在使用带有 gulp 的节点来运行一些构建任务。直到几天前,这一切正常。现在(我假设在升级/更新之后,不确定是哪个特定的。我相信这是节点从 14.4 到 14.5 的更新)我不断收到此警告
[DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Run Code Online (Sandbox Code Playgroud)
我不知道如何--trace-deprecation与 gulp一起使用,所以我找不到触发它的原因。
我的实际gulpfile更长,注释掉部分,更改pipeline为.pipe,更新节点和依赖项,使用async/await,以及其他一些小的更改并没有让我更接近缩小问题的范围。
因此,我在下面设置了这个最小的工作示例:
clean_fake) 不会触发警告gulp clean并gulp styles导致警告显示[DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Run Code Online (Sandbox Code Playgroud)
当前版本:
节点:v14.5.0
npm:6.14.6
删除:5.1.0
吞咽:4.0.2
吞咽:4.1.0
PS:有这个类似的问题,但我的问题没有答案。
我想出了如何通过运行它来跟踪弃用NODE_OPTIONS:
NODE_OPTIONS='--trace-deprecation' gulp
Run Code Online (Sandbox Code Playgroud)
但是输出对我没有多大帮助
(node:146806) [DEP0097] DeprecationWarning: Using a domain property in MakeCallback is deprecated. Use the async_context variant of MakeCallback or the AsyncResource class instead.
at emitMakeCallbackDeprecation (domain.js:123:13)
at FSReqCallback.topLevelDomainCallback (domain.js:134:5)
at FSReqCallback.callbackTrampoline (internal/async_hooks.js:121:14)
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
1467 次 |
| 最近记录: |