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

再安装就好了:

相关推荐
乌兰麦朵13 分钟前
Vue吹的颅内高潮,全靠选择性失明和 .value 的PUA!
前端·vue.js
Code季风14 分钟前
Gin Web 层集成 Viper 配置文件和 Zap 日志文件指南(下)
前端·微服务·架构·go·gin
蓝倾14 分钟前
如何使用API接口实现淘宝商品上下架监控?
前端·后端·api
舂春儿16 分钟前
如何快速统计项目代码行数
前端·后端
毛茸茸16 分钟前
⚡ 从浏览器到编辑器只需1秒,这个React定位工具改变了我的开发方式
前端
Pedantic16 分钟前
我们什么时候应该使用协议继承?——Swift 协议继承的应用与思
前端·后端
Software攻城狮17 分钟前
vite打包的简单配置
前端
Codebee17 分钟前
如何利用OneCode注解驱动,快速训练一个私有的AI代码助手
前端·后端·面试
流星稍逝18 分钟前
用vue3的写法结合uniapp在微信小程序中实现图片压缩、调整分辨率、做缩略图功能
前端·vue.js
知了一笑21 分钟前
独立开发问题记录-margin塌陷
前端