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

再安装就好了:

相关推荐
LinXunFeng6 分钟前
Flutter - GetX Helper 如何应用于旧页面
前端·flutter·开源
紫薯馍馍23 分钟前
Dify创建 echarts图表 (二)dify+python后端flask实现
前端·flask·echarts·dify
梦想很大很大41 分钟前
把业务逻辑写进数据库中:老办法的新思路(以 PostgreSQL 为例)
前端·后端·架构
李三岁_foucsli1 小时前
从生成器和协程的角度详解async和await,图文解析
前端·javascript
柚子8161 小时前
CSS自定义函数也来了
前端·css
zayyo1 小时前
面试官问我,后端一次性返回十万条数据,前端应该怎么处理 ?
前端·javascript·面试
Ai财富密码1 小时前
【Linux教程】Linux 生存指南:掌握常用命令,避开致命误操作
java·服务器·前端
鸿蒙预备高级程序员1 小时前
HarmonyOS5: LazyForEach的用法、功能及其与ForEach的区别
前端
实习生小黄1 小时前
双三次贝塞尔曲面-canvas 实现4x4网格图片变化功能
前端·算法
xingba1 小时前
改造jsp项目的alert框和confirm框
前端·javascript·css