Laravel Nova installation via composer fails on production server

Viewed 2992

I have added Laravel Nova to our application and purchased a license. On the local server everything works perfectly. However, when I try to deploy the updated application to our linux server and run composer update it says:

Failed to download laravel/nova from dist: /var/www/{myPath} does not exist and could not be created.
    Now trying to download from source

Syncing laravel/nova (3.29.0) into cache

Cloning failed using an ssh key for authentication, enter your GitHub credentials to access private repos
Head to https://github.com/settings/tokens/new It will be stored in "/var/www/{myPath}"

So I created a GitHub Token and added the Laravel Nova credentials to the auth.json file on the server too. Everything should be correct and it is working on the local copy as I said before. However, I am getting the following errors:

[RuntimeException]                                                                                                                                    
Failed to execute git clone --mirror -- 'git@github.com:laravel/nova.git' '/var/www/{myPath}/.cache/composer/vcs/git-github.com-laravel-nova.git/'                                                                                                                                              
                                                                                                                                                        
Cloning into bare repository '/var/www/{myPath}/.cache/composer/vcs/git-github.com-laravel-nova.git'...                                     
ERROR: Repository not found.                                                                                                                          
fatal: Could not read from remote repository.                                                                                                         
                                                                                                                                                        
Please make sure you have the correct access rights                                                                                                   
and the repository exists.      

How could I solve this problem?

3 Answers

Deleting the /vendor directory and the composer.lock file and running composer install --optimize-autoloader --no-devsolved the problem.

I had a similar problem and finally figured out the cause and its due to the laravel/nova:3.29. A minor upgrade to 3.30 fixed the issue for me without having to delete the whole composer.lock file as it will update some other packages as well.

  1. Create file at root directory with name "auth.json"
  2. copy your nova credentials to it
{
    "http-basic": {
        "nova.laravel.com": {
            "username": "email",
            "password": "passsword"
        }
    }
}
  1. composer update
Related