[英]The command “COMPOSER_MIRROR_PATH_REPOS=1 composer install” failed error when running laravel vapor deploy
我正在使用最新的 Laravel 7 開發一個應用程序,同時使用 Vapor 部署到 AWS。 我在 Windows 10 環境中。
運行以下命令部署到暫存vendor/bin/vapor deploy
時,出現以下錯誤。
In Process.php line 252:
The command "COMPOSER_MIRROR_PATH_REPOS=1 composer install" failed.
Exit Code: 1(General error)
Working directory: C:\Users\Matthew Wallace\Development\web\615ioDemos/.vap
or/build/app
Output:
================
Error Output:
================
'COMPOSER_MIRROR_PATH_REPOS' is not recognized as an internal or external c
ommand,
operable program or batch file.
此問題的解決方案是打開 vapor.yml 並修改build:
通過刪除 'COMPOSER_MIRROR_PATH_REPOS=1' 用於暫存和生產的部分
這就是我的構建部分現在的樣子。
build:
- 'composer install'
- 'php artisan event:cache'
- 'npm ci && npm run dev && rm -rf node_modules'
上面的答案只是部分修復。 (@mattwallace 回答)
整個故事:
COMPOSER_MIRROR_PATH_REPOS=1
"COMPOSER_MIRROR_PATH_REPOS": true
更多細節:
在使用 Win 時將數據庫附加到您的應用程序時,您可能會遇到問題(至少我做到了:P)。
問題在於解決路徑的策略。 默認情況下,策略設置為“符號鏈接”——我認為更合適的方法是將其設置為“鏡像”,因為我們在本地構建項目並將內容移動到不同的主機(文件系統結構等)。
上面的錯誤只是終端/powershell 不知道如何處理命令行中的第一個參數 - COMPOSER_MIRROR_PATH_REPOS
- 它仍然需要設置。
更多關於這里的參數。
在文檔中,您可以找到:
您可以設置許多覆蓋某些設置的環境變量。 建議盡可能在 composer.json 的配置部分指定這些設置。
你有 go:
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true,
"COMPOSER_MIRROR_PATH_REPOS": true
},
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.