composer 服務器安裝擴展失敗(版本太低的 升級過程)

ps : 服務器 配置
Linux VM-0-9-ubuntu 4.4.0-91-generic #114-Ubuntu SMP Tue Aug 8 11:56:56 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

1. 失敗經歷

安裝 easyswoole 的過程當中,發現沒法經過 composer 安裝laravel

報錯信息以下:json

ubuntu@VM-0-9-ubuntu:~/demo/easyswoole$ composer require easyswoole/easyswoole=3.x
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)

Installation failed, deleting ./composer.json.

                                                                                           
  [ErrorException]                                                                         
  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?  
                                                                                           

require [--dev] [--prefer-source] [--prefer-dist] [--no-plugins] [--no-progress] [--no-update] [--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--] [<packages>]..

google 一下,沒有對應的錯誤信息。 想着先查看一下 composer 版本ubuntu

發現 : composer 版本太低,就順便升級composer 升級了再說。服務器

ubuntu@VM-0-9-ubuntu:~/demo/easyswoole$ composer -V
Composer version @package_branch_alias_version@ (1.0.0-beta2) 2016-03-27 16:00:34

升級的過程當中發現,升級失敗。 老版本的 composer 不能自動升級swoole

ubuntu@VM-0-9-ubuntu:~$ composer self-update

                                         
  [InvalidArgumentException]             
  Command "self-update" is not defined.

看來是 composer 包過低,都沒有自動升級的功能composer

2. 下載新的 composer 包

1. 新增最新的composer

wget https://dl.laravel-china.org/composer.phar -O /usr/local/bin/composer

 sudo chmod a+x /usr/local/bin/composer

而後把腳本 覆蓋到原來的 (經過軟鏈)ui

2. 查看原來的位置

clipboard.png

sudo mv /usr/bin/composer /tmp/ 
sudo ln -s /usr/local/bin/composer  /usr/bin/composer

ubuntu@VM-0-9-ubuntu:~$ composer -V
Composer version 1.8.5 2019-04-09 17:46:47google

3. 安裝

使用 composer 安裝項目spa

clipboard.png

相關文章
相關標籤/搜索