node.js - SyntaxError: Unexpected token { at exports.runInThisContext (vm.js:53:16) in elasticdump
问题描述
I was trying to move elasticsearch data from one server to another using elasticdump. When I giving
elasticdump --input=http://192.168.0.122:9200/my_index --output=http://localhost:9200/my_index --type=mapping
/usr/local/lib/node_modules/elasticdump/lib/transports/elasticsearch.js:668 var { awsChain, awsAccessKeyId, awsIniFileProfile } = self.parent.options ^
SyntaxError: Unexpected token { at exports.runInThisContext (vm.js:53:16) at Module._compile (module.js:374:25) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Module.require (module.js:354:17) at require (internal/module.js:12:17) at getIo (/usr/local/lib/node_modules/elasticdump/lib/ioHelper.js:29:18) at new elasticdump (/usr/local/lib/node_modules/elasticdump/elasticdump.js:43:3) at Object. (/usr/local/lib/node_modules/elasticdump/bin/elasticdump:96:16)
How should I solve this error?
解决方案
问题是您的 Node.js 版本太旧,不支持最新功能。
elasticdump至少需要 node.js v8+,所以你应该升级 node.js然后它应该可以工作。
推荐阅读
- android - 如何听改变高度底部表格布局android
- powershell - 设置用户:使用 Connect-ExchangeOnline 找不到与参数名称“标题”匹配的参数
- java - spring requestmapping测试代码不起作用
- junit - 如何使用 Mockito 以通过 javax 验证的方式模拟一个类
- typescript - 以角度 8 动态触发点击事件
- python - 如何在一个 pandas 数据帧的行中的 ID 组并使用它们从另一个数据帧中提取记录
- python - Tkinter 回调中的异常,_tkinter.TclError:预期的整数但得到“”
- oracle - Oracle 旧的 Lelft 连接语法 (+) 在连接条件中与 Like 运算符一起使用
- flutter - 如何让 Positioned 小部件在 Stack (flutter) 中工作?
- java - 以下代码的时间复杂度是多少?