Node.js   发布时间:2022-04-24  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了node.js – ‘现在无法切换到旧模式’Elasticdump中的错误大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
我尝试使用elasticdump(在Node.js上)备份并恢复Elasticsearch中的json索引:

[备份]
elasticdump –input = http:// cred:entials@myserver.com:9200 / .kibana –output = kibana.json –type = data
(作品)

[恢复]
elasticdump –output = http:// cred:entials@myserver.com:9200 / .kibana –input = kibana.json –type = data(给出错误)

错误是:

_stream_readable.js:749
    throw new Error('CAnnot switch to old mode Now.');
          ^
Error: CAnnot switch to old mode Now.
    at emitDataEvents (_stream_readable.js:749:11)
    at ReadStream.Readable.pause (_stream_readable.js:740:3)
    at file.completeBatch (/usr/lib/node_modules/elasticdump/lib/transports/file.js:75:19)
    at Stream.<anonymous> (/usr/lib/node_modules/elasticdump/lib/transports/file.js:65:10)
    at Stream.emit (events.js:117:20)
    at drain (/usr/lib/node_modules/elasticdump/node_modules/through/index.js:34:23)

有谁知道发生了什么以及如何解决它?

解决方法

您的节点版本已过时.

尝试运行node –version,如果你得到1.0.0以下的任何东西,那么你需要升级本地版本的节点.

为了在本地管理多个节点版本,您可以使用n module.只需运行以下步骤即可

sudo npm install -g n
sudo n stable

然后你将安装最新版本的节点,elasticdump将再次运行.

大佬总结

以上是大佬教程为你收集整理的node.js – ‘现在无法切换到旧模式’Elasticdump中的错误全部内容,希望文章能够帮你解决node.js – ‘现在无法切换到旧模式’Elasticdump中的错误所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。