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

欢迎访问:天问博客

相关推荐
轻松Ai享生活4 小时前
5 节课深入学习Linux Cgroups
linux
christine-rr5 小时前
linux常用命令(4)——压缩命令
linux·服务器·redis
三坛海会大神5555 小时前
LVS与Keepalived详解(二)LVS负载均衡实现实操
linux·负载均衡·lvs
東雪蓮☆5 小时前
深入理解 LVS-DR 模式与 Keepalived 高可用集群
linux·运维·服务器·lvs
qq_264220895 小时前
LVS负载均衡群集和LVS+Keepalived群集
运维·负载均衡·lvs
乌萨奇也要立志学C++5 小时前
【Linux】进程概念(二):进程查看与 fork 初探
linux·运维·服务器
雨落Liy5 小时前
Nginx 从入门到进阶:反向代理、负载均衡与高性能实战指南
运维·nginx·负载均衡
Yyyy4826 小时前
Nginx负载均衡集群实验步骤
运维·nginx·负载均衡
獭.獭.7 小时前
Linux -- 信号【上】
linux·运维·服务器
hashiqimiya7 小时前
centos配置环境变量jdk
linux·运维·centos