首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Laravel :无法找到项目的依赖项

Laravel :无法找到项目的依赖项
EN

Stack Overflow用户
提问于 2021-12-03 15:04:51
回答 1查看 805关注 0票数 1

我正试图通过laravel蒸气来调配我的零钱,它告诉我:

代码语言:javascript
复制
/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 1: Merge: command not found
/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 3: hot-fix/vapor-issue: No such file or directory
Unable to find your project's dependencies. Please run the composer "install" command first.
Error: Process completed with exit code 1.

我试图在vapor.yml中改变一些事情,但没有解决任何问题:

代码语言:javascript
复制
environments:
    staging:
        timeout: 10
        concurrency: 94
        warm: 20
        storage: str-staging
        memory: 768
        cli-memory: 768
        runtime: 'php-7.4'
        database: db-development
        scheduler: false
        queue: true
        queue-concurrency: 1
        queue-timeout: 120
        queue-memory: 768
        mail: false
        domain:
            - staging.example.com
        build:
            - 'composer install -o --no-dev'
            - 'php artisan event:cache'
            - 'php artisan config:cache'
            - 'php artisan route:cache'
        deploy:
            - 'php artisan migrate --force'

知道吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2021-12-05 08:08:26

我找到了解决办法。

这是因为两个问题,它们都在yml配置中,在.github/workflows/中,我发现github在它们的操作中改变了一些东西。

我的yml配置有一个部分,如下所示:

代码语言:javascript
复制
- name: Deploy using Laravel Vapor
      env:
        VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
      run: /home/runner/.composer/vendor/bin/vapor deploy production --commit=`${{ github.event.head_commit.id }}` --message=`${{ github.event.head_commit.message }}`

但是他们删除了处理后引号(`),所以我把它改为双引号:

代码语言:javascript
复制
- name: Deploy using Laravel Vapor
      env:
        VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
      run: /home/runner/.composer/vendor/bin/vapor deploy production --commit="${{ github.event.head_commit.id }}" --message="${{ github.event.head_commit.message }}"

这解决了这两行问题:

代码语言:javascript
复制
/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 1: Merge: command not found
/home/runner/work/_temp/c6e18c6d-a186-46b8-9628-a123b8013114.sh: line 3: hot-fix/vapor-issue: No such file or directory

另一个问题是:

代码语言:javascript
复制
Unable to find your project's dependencies. Please run the composer "install" command first.
Error: Process completed with exit code 1.

在使用laravel蒸气部署之前,我必须添加composer install

yml配置更改:

代码语言:javascript
复制
- name: Install Composer dependencies
      run: composer install --prefer-dist --no-interaction --no-dev
- name: Deploy using Laravel Vapor
      env:
        VAPOR_API_TOKEN: ${{ secrets.VAPOR_API_TOKEN }}
      run: /home/runner/.composer/vendor/bin/vapor deploy production --commit="${{ github.event.head_commit.id }}" --message="${{ github.event.head_commit.message }}"

这对我有帮助,我希望它能帮助到其他人。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/70216400

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档