报错信息:

/usr/lib/node_modules/pm2/node_modules/chalk/source/index.js:103 ...styles,

这个问题其实很简单,就是npm和node的版本太低,但是我查了一下,我的npm版本是3.10,node版本是6.17

只需升级npm版本即可:

1. 卸载npm

npm uninstall npm -g

2. 安装gcc

yum install gcc gcc-c++

3. 自建一个文件夹下载node

mkdir npm
cd npm
wget https://npm.taobao.org/mirrors/node/v10.14.1/node-v10.14.1-linux-x64.tar.gz

4. 解压

tar -xvf  node-v10.14.1-linux-x64.tar.gz
mv node-v10.14.1-linux-x64 node

5. 添加环境变量

vi /etc/profile

在其中添加
export NODE_HOME=/root/npm/node
export PATH=$NODE_HOME/bin:$PATH

注意!! NODE_HOME后面的值要添加到自己的node解压的路径

6. 刷新配置

source /etc/profile

  

7. 看看自己的版本情况

node -v
npm -v

8. 安装pm2

npm install -g pm2<br><br>pm2 list

  

9. 完成

centos安装pm2报错的更多相关文章

  1. Centos 安装docker报错

    错误信息: 安装报错:Transaction check error:  file /usr/lib/systemd/system/blk-availability.service from inst ...

  2. CentOS安装Nginx 报错“configure: error: the HTTP rewrite module requires the PCRE library”解决办法

    错误提示: ./configure: error: the HTTP rewrite module requires the PCRE library.      yum install gcc gc ...

  3. CentOS安装openvpn报错:error: route utility is required but missing

    centos7特有,直接安装net-tools即可. 参考: https://forums.openvpn.net/viewtopic.php?t=21432

  4. centos安装rvm报错@curl -L get.rvm.io | bash -s stable fails on cent OS

    It is a security feature introduced in the latest version of RVMhttps://github.com/wayneeseguin/rvm/ ...

  5. CentOS安装Redis报错[server.o] Error 1

    原因 准备安装的Redis服务版本为6.0.8, gcc的版本为4.8.5,可能是gcc版本过低到导致的 解决办法 安装低版本Redis或者安装高版本gcc

  6. 安装docker报错:https://download.docker.com/linux/centos/7/i386/stable/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"

    如题,执行docker安装命令报错: [root@centos ~]# yum install docker-ce Loaded plugins: fastestmirror, security Se ...

  7. Centos下yum安装Nginx报错 No package nginx available.

    在Centos6下使用yum安装Nginx报错 解决方案: yum install epel-release

  8. 通过本地yum源安装软件报错[Errno 14] PYCURL ERROR 56 - "Failure when receiving data from the peer"

    通过本地yum源安装软件报错 http://192.168.3.85/centos/6/os/x86_64/Packages/php-pdo-5.3.3-47.el6.x86_64.rpm: [Err ...

  9. centOS下yum报错

    CentOS下yum报错 备注:当我们在CentOS下使用yum命令的时候,会报一些错误,一下是我总结的几个解决问题的方法.(保证自己的服务器可以上网) 一.关于Loaded plugins: fas ...

随机推荐

  1. Docker系列(1) - Centos8.X安装Docker

    环境准备 需要会Linux的基础 Centos8.x 使用Xshell连接远程服务器 环境查看 #系统内核是4.18以上 [root@localhost ~]# uname -r 4.18.0-305 ...

  2. 虚拟机乌班图系统安装 VMware tools 工具

    在VMware虚拟机中安装完毕Linux操作系统之后,我们经常会发现桌面不能全屏显示或者windows主机系统与linux操作系统之间无法创建共享文件夹.这是因为我们还没有安装VMware tools ...

  3. python线程threading

    线程示例: import threading import time # 唱歌任务 def sing(): # 扩展: 获取当前线程 # print("sing当前执行的线程为:" ...

  4. 【HTML】实战阿里云src页面css模仿基础学习

    实战结果页面gif图片 阿里云src首页模仿完整代码(500行左右) <!DOCTYPE html> <html> <head> <meta charset= ...

  5. Linux下实现高可用软件-Keepalived基础知识梳理

    Keepalived介绍 Keepalived软件起初是专门为LVS负载均衡软件设计的,用来管理并监控LVS集群系统中各个服务节点的状态,后来又加入了可以实现高可用的VRRP功能.因此,Keepali ...

  6. P4234-最小差值生成树【LCT】

    正题 题目链接:https://www.luogu.com.cn/problem/P4234 题目大意 给出\(n\)个点\(m\)条边的一张图.求一棵生成树使得最大边权减去最小边权最小. \(1\l ...

  7. if 条件

    返回不能被2整除的数 result = [] iter = range(10) for i in iter: if i % 2: print(f'{i}', i % 2) result.append( ...

  8. Vite插件开发纪实:vite-plugin-monitor(上)

    背景 最近在webpack项目里接入了Vite(dev mode),为开发提效.效果是真的猛. 项目启动速度提升70%-80%,HMR直接碾压webpack dev server 为了更加精准的计算收 ...

  9. 重新整理 .net core 周边阅读篇————AspNetCoreRateLimit 之规则[二]

    前言 本文和上文息息相关. https://www.cnblogs.com/aoximin/p/15315102.html 是紧接着上文invoke来书写的,那么现在来逐行分析invoke到底干了啥. ...

  10. 从commons-beanutils反序列化到shiro无依赖的漏洞利用

    目录 0 前言 1 环境 2 commons-beanutils反序列化链 2.1 TemplatesImple调用链 2.2 PriorityQueue调用链 2.3 BeanComparator ...