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

再安装就好了:

相关推荐
天天扭码6 小时前
如何实现流式输出?一篇文章手把手教你!
前端·aigc·ai编程
前端 贾公子7 小时前
vue移动端适配方案 === postcss-px-to-viewport
前端·javascript·html
GISer_Jing8 小时前
AI营销增长:4大核心能力+前端落地指南
前端·javascript·人工智能
明远湖之鱼8 小时前
一种基于 Service Worker 的渐进式渲染方案的基本原理
前端
前端小端长9 小时前
Vue 中 keep-alive 组件的原理与实践详解
前端·vue.js·spring
FeelTouch Labs9 小时前
Nginx核心架构设计
运维·前端·nginx
雪球工程师团队9 小时前
别再“苦力”写后台,Spec Coding “跑” 起来
前端·ai编程
m0_471199639 小时前
【场景】前端怎么解决离线收银、数据同步异常等场景问题
前端·javascript
Curvatureflight10 小时前
前端性能优化实战:从3秒到300ms的加载速度提升
前端·人工智能·性能优化