在安裝 thinkphp swoole 的時(shí)候,
composer require topthink/think-swoole
報(bào)錯(cuò)如下:
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
解決方法:
1、把需要引入的包寫入 composer.json 中(寫入的話,就不需要 composer require 了,直接composer update 即可。)
2、刪除 composer.lock
3、$ composer clearcache 清除緩存
4、$ composer update 更新依賴(重新生成 composer.lock)
例如:
上面的 topthink/think-swoole 組件,將它加入到 composer.json 的 require 對(duì)象里面,如果只是開發(fā)環(huán)境使用,就加入到 require-dev,然后按照上面步驟操作一遍:
"require": {
"php": ">=7.1.0",
"topthink/framework": "^6.0.0",
"topthink/think-orm": "^2.0",
"topthink/think-queue": "^3.0",
"predis/predis": "^1.1",
"marlon/thinkphp-redis": "^0.0.3",
"liliuwei/thinkphp-jump": "^1.5",
"topthink/think-swoole":"^3.1.0"
},
"require-dev": {
"symfony/var-dumper": "^4.2",
"topthink/think-trace":"^1.0"
},
建議看我comoser文集下另外一篇文章 也可解決該問題 ,更簡(jiǎn)單直接點(diǎn);