博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
node util.log_如何解决Node.js中的util.pump不是函数错误
阅读量:2504 次
发布时间:2019-05-11

本文共 926 字,大约阅读时间需要 3 分钟。

node util.log

If you experience the error “util.pump is not a function” while running a Node.js app or a Node.js snippet, it’s because the app code is too old for the current Node.js runtime.

如果在运行Node.js应用程序或Node.js代码段时遇到错误“ util.pump不是函数”,这是因为该应用程序代码对于当前的Node.js运行时而言太旧了。

The pump() method that Node.js provided wrote a readable to a writable stream using this syntax:

Node.js提供的pump()方法使用以下语法将可读写入可写流:

util.pump(readableStream, writableStream)

This method is now gone, deprecated for a long time and removed when Node.js 6.0 was released in April 2016.

该方法现已消失,不推荐使用很长时间,并于2016年4月发布Node.js 6.0时将其删除。

Luckily, it’s easy to fix this problem.

幸运的是,解决此问题很容易。

Replace the above syntax with:

将以上语法替换为:

const { pipeline } = require('stream')//...pipeline(readableStream, writableStream, () => {})

The third argument is a callback function that will be called when the pipeline is done.

第三个参数是在完成管道后将调用的回调函数。

.

翻译自:

node util.log

转载地址:http://ptmgb.baihongyu.com/

你可能感兴趣的文章
python 递归求阶乘
查看>>
ERROR: child process failed, exited with error number 100
查看>>
Java计算器源代码
查看>>
SQLServer视图
查看>>
《Entity Framework 6 Recipes》翻译系列 (3) -----第二章 实体数据建模基础之创建一个简单的模型...
查看>>
入门阶段
查看>>
游戏制作人的职能
查看>>
学生信息管理系统应用ios源码iPad版
查看>>
Android中使用http协议访问网络
查看>>
ASP.NET Core 菜鸟之路:从Startup.cs说起
查看>>
vs win32 & MFC 指针默认位置
查看>>
Join 与 CountDownLatch 之间的区别
查看>>
js存cookie
查看>>
vc6下dll调试
查看>>
Ubuntu apt常用命令
查看>>
struts2 配置(部分)
查看>>
python代码迷之错误(ModuleNotFoundError: No module named 'caffe.proto')
查看>>
nodejs adm-zip 解压文件 中文文件名乱码 问题解决
查看>>
阿里程序员:我年薪260万+3000万期权,协和医生一辈子都赚不到
查看>>
MapReduce-文本输入
查看>>