首页 > 解决方案 > 通过作曲家安装 Laravel Nova 在生产服务器上失败

问题描述

我已将 Laravel Nova 添加到我们的应用程序中并购买了许可证。在本地服务器上一切正常。但是,当我尝试将更新的应用程序部署到我们的 linux 服务器并运行composer update它说:

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

所以我创建了一个GitHub 令牌并将 Laravel Nova 凭据添加到服务器上的auth.json文件中。一切都应该是正确的,并且正如我之前所说,它正在处理本地副本。但是,我收到以下错误:

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

我该如何解决这个问题?

标签: laravelcomposer-phplaravel-nova

解决方案


删除/vendor目录和composer.lock文件并运行composer install --optimize-autoloader --no-dev解决了问题。


推荐阅读