Home > Software design >  Laravel Vapor: Unable to find your project's dependencies
Laravel Vapor: Unable to find your project's dependencies

Time:12-05

I am trying to deploy my change via laravel vapor and it's telling me:

/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.

I tried to change things in vapor.yml but nothing solved:

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'

Any idea ?

CodePudding user response:

It seems that he could not find the files. The error message tells you to run: composer install first. That will solve the problem.

CodePudding user response:

I found a solution.

This was because of two issues and both of them was in yml configuration inside .github/workflows/ where i found that github change something in their actions.

My yml config had a part like the following:

- 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 }}`

But they remove dealing with back quote (`) so i changed it to be double quots:

- 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 }}"

This solves these two lines of issues:

/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

The other problem with:

Unable to find your project's dependencies. Please run the composer "install" command first.
Error: Process completed with exit code 1.

I had to add composer install before deploy using laravel vapor:

yml config change:

- 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 }}"

That helps me, i hope it will help others.

  • Related