前言
Vscode报错:
phpcs: Request workspace/configuration failed with message: Unable to locate phpcs. Please add phpcs to your global path or use composer dependency manager to install it in your project locally.
解决办法:
第一步:确保在当前目录存在composer.json
文件,如果不存在使用composer init
初始化
第二步:确保源已经更改为国内源,如果没有请按照下列方式设置
全局配置(推荐)
所有项目都会使用该镜像地址:
composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
取消配置:
composer config -g --unset repos.packagist
第三步
系统级全局安装
composer global require squizlabs/php_codesniffer
网友评论