> ## Content Index
> Fetch the complete content index at: https://sgpublic.xyz/llms.txt
> Use this file to discover other available public pages before exploring further.

# -bash: pm2: 未找到命令
- URL: https://sgpublic.xyz/p/2021/05/6aac9cb1810a4800015335e6/
- Published: 2021-05-08T08:47:15.000Z
- Updated: 2021-05-08T08:47:15.000Z
- Author: Haven Madray
- Tags: 软件开发, Node.js, #wp-post

> 转自 [\-bash: pm2: 未找到命令（怎么办）\_侒然的博客-CSDN博客\_-bash: pm2: 未找到命令](https://blog.csdn.net/Janent168/article/details/111086263?ref=sgpublic.xyz)

安装pm2后执行

```
[root@iZjws8m7rlbqecZ blog-backed]# pm2 -v
-bash: pm2: 未找到命令
```

修改路径

```
ln -s /root/node-v14.14.0-linux-x64/lib/node_modules/pm2/bin/pm2 /usr/local/bin/
```

如果显示文件已经存在，用mv删除之后再执行上一步

```
mv /usr/local/bin/pm2 /tmp/
ln -s /root/node-v14.14.0-linux-x64/lib/node_modules/pm2/bin/pm2 /usr/local/bin/
```

![](https://img-blog.csdnimg.cn/20201212223029480.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L0phbmVudDE2OA==,size_16,color_FFFFFF,t_70)