centos安装pm2报错
报错信息:
/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报错的更多相关文章
- Centos 安装docker报错
错误信息: 安装报错:Transaction check error: file /usr/lib/systemd/system/blk-availability.service from inst ...
- 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 ...
- CentOS安装openvpn报错:error: route utility is required but missing
centos7特有,直接安装net-tools即可. 参考: https://forums.openvpn.net/viewtopic.php?t=21432
- 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/ ...
- CentOS安装Redis报错[server.o] Error 1
原因 准备安装的Redis服务版本为6.0.8, gcc的版本为4.8.5,可能是gcc版本过低到导致的 解决办法 安装低版本Redis或者安装高版本gcc
- 安装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 ...
- Centos下yum安装Nginx报错 No package nginx available.
在Centos6下使用yum安装Nginx报错 解决方案: yum install epel-release
- 通过本地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 ...
- centOS下yum报错
CentOS下yum报错 备注:当我们在CentOS下使用yum命令的时候,会报一些错误,一下是我总结的几个解决问题的方法.(保证自己的服务器可以上网) 一.关于Loaded plugins: fas ...
随机推荐
- verifycode验证码模版
# -*- coding:utf-8 -*- from django.shortcuts import HttpResponse def verifycode(request): # 引入绘图模块 f ...
- 『GoLang』字典Map
map是一种元素对的无序集合,一组称为元素value,另一组为唯一键索引key. 未初始化map的值为nil.map 是引用类型,可以使用如下声明: var map1 map[keytype]valu ...
- HTML 网页开发、CSS 基础语法——八.HTML基本语法
表格制作 1.表格基础 创建一个简单的表格至少有三个标签组成,分别是<table>,<tr>,<td>标签. table:表格,定义的是整个的表格大结构. tr:t ...
- AT4120-[ARC096D]Sweet Alchemy【贪心,背包】
正题 题目链接:https://www.luogu.com.cn/problem/AT4120 题目大意 给出\(n\)个物品和一个容量\(m\),第\(i\)个物品体积为\(c_i\).除了第一个物 ...
- 测试用例 setup 和 和 teardown
前言 学过unittest的都知道里面用前置和后置setup呾teardown非常好用,在每次用例开始前呾结束后都去执行一次.当然迓有更高级一点的 setupClass 呾 teardownClass ...
- 一、mybatis入门案例
今天学习了mybatis框架,简单记录一下mybatis第一个入门案例,目标是使用Mybatis作为持久层框架,执行查询数据的SQL语句并且获取结果集 基本步骤: 物理建模 逻辑建模 引入依赖 创建持 ...
- netty 处理客户端连接
Netty如何处理连接事件 上文讲了Netty如何绑定端口,现在我们来阅读下netty如何处理connect事件.上文我们说了NioEventLoop启动后不断去调用select的事件,当客户端连接时 ...
- 演员 Or 开发者的自我修养
演员 Or 开发者的自我修养 时至今日,我都还是很怀念小时候与一群玩伴编写剧本.拍摄,那时候的我还有一个远大的"白日梦"--成为一名导演.很可惜,终究是"白日梦" ...
- python 注册 gin consul
import requests headers = { "contentType": "application/json" } def register(nam ...
- 【Ubuntu】VirtualBox 您没有查看“sf_VirtualDisk”的内容所需的权限
但是现在发现无法去访问,没有权限: 即使是: crifan@crifan-Ubuntu:~$ sudo chown -R crifan /media/sf_win7_to_ubuntu/ cr ...