問題:
在專案目錄下執行
% composer update topthink/framework
1.執行上面的命令下載tp5.1的核心框架think php,報錯無法下載,保存,無法解壓下載的臨時檔案
Failed to extract topthink/framework: (9) unzip -qq ‘/Users/liangyuji/Desktop/workspace/www/layuji/vendor/composer/tmp-2aed41abee1ebb45f997bb9298058753’ -d ‘/Users/liangyuji/Desktop/workspace/www/layuji/vendor/composer/45fda960’
unzip: cannot find or open /Users/liangyuji/Desktop/workspace/www/layuji/vendor/composer/tmp-2aed41abee1ebb45f997bb9298058753.
- 難道是打開的方式不對?換個姿勢看看
% composer require topthink/think-installer
Failed to extract topthink/framework: (9) unzip -qq '/Users/liangyuji/Desktop/workspace/www/layuji/vendor/composer/tmp-d7b9c1894bc64bc0bfc97e4456d5f78b' -d '/Users/liangyuji/Desktop/workspace/www/layuji/vendor/composer/44c44b00'
unzip: cannot find or open /Users/liangyuji/Desktop/workspace/www/layuji/vendor/composer/tmp-d7b9c1894bc64bc0bfc97e4456d5f78b.
This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix
Generating autoload files
還是報錯!!!
有個提示??:
This most likely is due to a custom installer plugin not handling the returned Promise from the downloader
See https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb for an example fix
大部分這種情況是由于插件問題導致無法下載,可以查看https://github.com/composer/installers/commit/5006d0c28730ade233a8f42ec31ac68fb1c5c9bb的列子進行修復
方案
更換composer的鏡像為阿里的鏡像
注意:最近phpcomposer鏡像存在問題,可以改成
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
更換鏡像源是否可行,但還是一樣,
按上面的提示進行修復,查看網址案例:
1.第一個回復是說使用1.x x x 的版本即可
use version 1.xxx is ok.
使用1.xxx版本可以,
查看自己的版本,為2.0的版本
liangyuji@liangyujideMacBook-Pro layuji % composer -v
______
/ ____/___ ____ ___ ____ ____ ________ _____
/ / / __ \/ __ `__ \/ __ \/ __ \/ ___/ _ \/ ___/
/ /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
\____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
/_/
Composer version 2.0.7 2020-11-13 17:31:06
2.第二個回復是說插件不兼容
This is due to a custom installer plugin interacting badly with Composer 2.
這是因為自定義安裝程式插件與Composer 2互動不良,
這時可以看一下是專案目錄的哪個插件問題
unzip: cannot find or open /Users/liangyuji/Desktop/workspace/www/layuji/vendor/composer/tmp-d7b9c1894bc64bc0bfc97e4456d5f78b.
無法解壓vendor/composer/下的檔案

將該composer的檔案夾目錄洗掉,重新執行下載命令,即可
liangyuji@liangyujideMacBook-Pro layuji % composer update topthink/framework
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
- Downloading topthink/framework (v5.1.41)
- Installing topthink/think-installer (v2.0.5): Extracting archive
- Installing nowakowskir/php-jwt (2.0.1): Extracting archive
- Installing topthink/framework (v5.1.41): Extracting archive
Generating autoload files
可以看到執行后回重新下載composer目錄并安裝thinkphp成功,
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/255275.html
標籤:區塊鏈
上一篇:css入門基礎
