繁体   English   中英

Gitlab CI:未找到纱线

[英]Gitlab CI: Yarn not found

stages:
    - .pre
    - build
    - test

build website:
    image: node:16-alpine
    stage: build
    script:
        - yarn install
        - yarn build
    artifacts:
        paths:
            - build

       

test website:
    image: alpine
    stage: test
    script:
        - yarn global add serve
        - serve -s build 
       
        

我正在尝试对 gitlab ci 进行集成测试,但是当我提交并尝试运行此 yaml 文件时,它输出/bin/sh: eval: line 126: yarn: not found

有什么我想念的吗?

看起来在“测试网站”中使用的名为“alpine”的图像中没有安装纱线。 你可以做的是:

  • 如果未安装 yarn 实用程序,请检查此图像是否安装了 yarn
  • 或者简单地使用默认安装了纱线的图像

此外,您似乎没有在测试中使用该工件,因此当您修复纱线问题时,您将面临这个问题。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM