是不是遇到过bash: composer: command not found问题,怎么解决呢?下面由composer教程栏目给大家来详细介绍该问题的解决方法。
1、先看报错

2、由于错误的原因,安装很多东西都失败了。网上有的说是环境变量的问题,又一个个找也没解决,后来看到个简单粗暴的方法试了一下就成功了
3、我用的是phpstudy,将 phpstudy\Extensions\composer1.8.5 文件夹下的composer.phar和composer.bat 和 composer 复制到当前使用版本的php文件夹下


3、执行如下命令,更新自己的composer版本
php
composer config repo.packagist composer https://packagist.phpcomposer.com
4、执行完成后会在自己项目的composer.json文件中看到一行代码
php
"repositories": {
"packagist": {
"type": "composer",
"url": "https://packagist.phpcomposer.com"
}
}
5、查看安装版本
