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

欢迎访问:天问博客

相关推荐
诚信爱国敬业友善6 分钟前
GUI编程(window系统→Linux系统)
linux·python·gui
sekaii7 分钟前
ReDistribution plan细节
linux·服务器·数据库
YH_DevJourney1 小时前
Linux-C/C++《C/8、系统信息与系统资源》
linux·c语言·c++
威哥爱编程1 小时前
Linux驱动开发13个实用案例
linux
去看日出2 小时前
Linux(centos)系统安装部署MySQL8.0数据库(GLIBC版本)
linux·数据库·centos
qq_448941082 小时前
10、k8s对外服务之ingress
linux·容器·kubernetes
D-river2 小时前
【如何基于Debian构建Kali Linux】
linux·网络·安全·网络安全
年轮不改3 小时前
ARM-Linux 基础项目篇——简单的视频监控
linux·arm开发
m0_748238783 小时前
Nginx 负载均衡详解
运维·nginx·负载均衡
EasyNVR4 小时前
EasyRTC:全平台支持与自研算法驱动的智能音视频通讯解决方案
运维·服务器·小程序·音视频·webrtc·p2p·智能硬件