Centos系统pnpm升级报错 ERR_PNPM_NO_GLOBAL_BIN_DIR

CentOS 系统中使用 pnpm i -g pnpm 报错:ERR_PNPM_NO_GLOBAL_BIN_DIR Unable to find the global bin directory,折腾半天终于解决了。

完整报错信息

js 复制代码
[root@VM-8 test]# pnpm i -g pnpm
Nothing to stop. No server is running for the store at /root/.local/share/pnpm/store/v3
ERR_PNPM_NO_GLOBAL_BIN_DIR Unable to find the global bin directory

Run "pnpm setup" to create it automatically, or set the global-bin-dir setting, or the PNPM_HOME env variable. The global bin directory should be in the PATH.

按照给出的提示运行 pnpm setup,再次执行 pnpm i -g pnpm 发现还是出现以上报错。

最后才明白执行 pnpm setup 其实是在环境变量中添加了一些 pnpm 的配置,虽然去查看环境变量已存在,但是并没有生效。

因为缺少了一个重要步骤,那就是 source ~/.bashrc,这样才能使环境变量生效。

总结

出现这种报错:ERR_PNPM_NO_GLOBAL_BIN_DIR Unable to find the global bin directory,执行以下两个命令就可以解决:

shell 复制代码
pnpm setup

# CentOS 系统
source ~/.bashrc

# MacOS 系统
source ~/.zshrc

欢迎访问:天问博客

相关推荐
lhxcc_fly几秒前
Linux网络--6、网络层
linux·网络·ip
刺客xs4 分钟前
linux GDB调试器
linux·运维·windows
板鸭〈小号〉1 小时前
connect 的断线重连
运维·服务器
wydaicls1 小时前
Linux 内核伙伴系统在快速路径分配内存时,对一个内存区域(Zone)进行水位线检查和内存压力评估的关键逻辑
linux·服务器
今天只学一颗糖2 小时前
Linux学习笔记--GPIO子系统和PinCtrl子系统
linux·笔记·学习
黄昏晓x2 小时前
Linux----权限
linux·运维·服务器
小白不想白a2 小时前
【shell】每日shell练习(系统服务状态监控/系统性能瓶颈分析)
linux·运维·服务器
一匹电信狗2 小时前
【MySQL】数据库的相关操作
linux·运维·服务器·数据库·mysql·ubuntu·小程序
迦蓝叶2 小时前
JAiRouter v1.0.0 正式发布:企业级 AI 服务网关的开源解决方案
java·运维·人工智能·网关·spring·ai·开源
bugtraq20213 小时前
为什么.NET的System.IO.Compression无法解压zlib流
linux·运维·服务器