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

再安装就好了:

相关推荐
a11177616 分钟前
粒子化系统(3D-Particles)THreeJS react
前端·html·jetson
码农君莫笑30 分钟前
深入理解 CSS Grid 布局:从入门到实战
前端·css
yingyima44 分钟前
Azure Functions 定时触发器配置:Cron vs. TimerTrigger,谁主沉浮?
前端
TeamDev1 小时前
JxBrowser 9.1.1 版本发布啦!
java·前端·chromium·混合应用·jxbrowser·嵌入式浏览器·浏览器控件
爱勇宝1 小时前
如何评估 AI 大模型的商业价值?
前端·后端·程序员
蜡台1 小时前
UniApp WebView 组件宽高设置与动态适配全方案
前端·javascript·uniapp·webview·iframe
半个烧饼不加肉1 小时前
JS 底层探究-- 调用栈(Call Stack)
开发语言·前端·javascript
子午2 小时前
基于DeepSeek的智能校园教务管理系统~Web管理系统+Vue3+Python+DeepSeek智能问答
前端
change_fate2 小时前
ERR_PNPM_WORKSPACE_PKG_NOT_FOUND In ...
java·服务器·前端
超人不会飞_Jay2 小时前
26.6.3Vue笔记
前端·vue.js·笔记