github使用action出错Unable to locate executable file: pnpm. Please verify either the file path exists

报错信息:

Run actions/setup-node@v4

13Found in cache @ /Users/runner/hostedtoolcache/node/20.14.0/arm64

Environment details

18Error: Unable to locate executable file: pnpm. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.

Install frontend dependencies

在使用github action安装依赖的时候:

yaml 复制代码
 - name: Sync node version and setup cache
        uses: actions/setup-node@v3
        with:
          node-version: 'lts/*'
          cache: 'pnpm' # Set this to npm, yarn or pnpm.

就是这里报的错,所以需要修改一下:改为下面的格式

yaml 复制代码
            - name: Sync node version and setup cache
              uses: actions/setup-node@v4
              with:
                  node-version: 20

            - name: Install PNPM
              run: npm i -g pnpm

再安装就好了:

相关推荐
moshuying9 小时前
别让AI焦虑,偷走你本该有的底气
前端·人工智能
GIS之路10 小时前
ArcPy,一个基于 Python 的 GIS 开发库简介
前端
可夫小子11 小时前
OpenClaw基础-为什么会有两个端口
前端
喝拿铁写前端11 小时前
Dify 构建 FE 工作流:前端团队可复用 AI 工作流实战
前端·人工智能
喝咖啡的女孩12 小时前
React 合成事件系统
前端
从文处安12 小时前
「九九八十一难」组合式函数到底有什么用?
前端·vue.js
用户59625857360612 小时前
戴上AI眼镜逛花市——感受不一样的体验
前端
yuki_uix12 小时前
Props、Context、EventBus、状态管理:组件通信方案选择指南
前端·javascript·react.js
老板我改不动了12 小时前
前端面试复习指南【代码演示多多版】之——HTML
前端
panshihao12 小时前
Mac 环境下通过 SSH 操作服务器,完成前端静态资源备份与更新(全程实操无坑)
前端