【笔记】Pnpm安装全局依赖时报错

前言

Windows通过pnpm install -g安装全局依赖时报错: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.

原因

  • Windows通过winget install pnpm.pnpm安装完后没有初始化

解决问题

1
pnpm setup
  • 重启终端

完成