centos6安装elasticdump

1.下载nodejs,如centos上面网络不太好,可以在本地浏览器下载好之后上传到服务器

wget  https://nodejs.org/dist/v11.10.0/node-v11.10.0-linux-x64.tar.xz
tar xvJf  node-v11.10.0-linux-x64.tar.xz

2.进到bin目录查看版本,发现npm命令不可以用,需要重新安装过才行

cd /work/node-v11.10.0-linux-x64/bin

/work/node-v11.10.0-linux-x64/lib/node_modules/npm/bin/npm-cli.js:85
      let notifier = require('update-notifier')({pkg})
          ^^^^^^^^
SyntaxError: Unexpected identifier
    at Module._compile (module.js:439:25)
    at Object.Module._extensions..js (module.js:474:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Function.Module.runMain (module.js:497:10)
    at startup (node.js:119:16)
    at node.js:945:3

 

3.设置环境变量

sudo vi /etc/profile

文件末尾加入

export NODE_HOME=/work/node-v11.10.0-linux-x64
export PATH=$NODE_HOME/bin:$PATH
export NODE_PATH=$NODE_HOME/lib/node_modules

完成编辑后,执行source /etc/profile

4.查看环境变量是否生效

5.下载npm的rpm包,该包可能不是最好匹配

http://www.rpmfind.net/linux/rpm2html/search.php?query=npm&submit=Search+...&system=centos&arch=

6.安装,可能报错

[appadmin@disrtsvr02 work]$ sudo yum -y localinstall npm-6.9.0-1.10.16.3.2.module_el8.0.0+186+
542b25fc.x86_64.rpm Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Local Package Process
Examining npm-6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.x86_64.rpm: 1:npm-6.9.0-1.10.16.3.
2.module_el8.0.0+186+542b25fc.x86_64Marking npm-6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.x86_64.rpm to be installed
Loading mirror speeds from cached hostfile
Could not get metalink https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=x86_64 erro
r was14: problem making ssl connection
 * epel: mirrors.tuna.tsinghua.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package npm.x86_64 1:6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc will be installed
--> Processing Dependency: nodejs = 1:10.16.3-2.module_el8.0.0+186+542b25fc for package: 1:npm
-6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.x86_64--> Processing Dependency: /usr/bin/sh for package: 1:npm-6.9.0-1.10.16.3.2.module_el8.0.0+186
+542b25fc.x86_64--> Processing Dependency: /usr/bin/sh for package: 1:npm-6.9.0-1.10.16.3.2.module_el8.0.0+186
+542b25fc.x86_64--> Finished Dependency Resolution
Error: Package: 1:npm-6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.x86_64 (/npm-6.9.0-1.10.16
.3.2.module_el8.0.0+186+542b25fc.x86_64)           Requires: /usr/bin/sh
Error: Package: 1:npm-6.9.0-1.10.16.3.2.module_el8.0.0+186+542b25fc.x86_64 (/npm-6.9.0-1.10.16
.3.2.module_el8.0.0+186+542b25fc.x86_64)           Requires: nodejs = 1:10.16.3-2.module_el8.0.0+186+542b25fc
           Installed: nodejs-0.10.48-3.el6.x86_64 (@epel)
               nodejs = 0.10.48-3.el6
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

 

改为另一种方式执行(只是忽略报错,没有根本上解决错误)

sudo yum -y localinstall npm-6.9.0-1.10.16.3.2.module_el8.0.0+186+
542b25fc.x86_64.rpm --skip-broken

7.安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

8.安装elasticdump

cnpm install elasticdump -g

9.测试elasticdump命令,发现能够导出成功

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值