Visual Studio Code:无法找到 phpcs [英] Visual Studio Code: Unable to locate phpcs
问题描述
我在 Visual Studio Code 中遇到了这个问题.我已经尝试重新安装 phpcs 扩展,但仍然面临这个问题.
I am facing this issue in Visual Studio Code. I have already tried reinstalling the phpcs extension but still facing this issue.
无法定位 phpcs
请将 phpcs
添加到您的全局路径或使用 Composer 依赖管理器在 Visual Studio Code 中本地安装到您的项目中
Please add phpcs
to your global path or use the composer dependency manager to install it in your project locally in Visual studio Code
推荐答案
我遇到了同样的问题,我做了以下修复:
I had the same issue, I did the following to fix it:
使用 composer 安装 phpcs,
composer global require squizlabs/php_codesniffer
按 Command + ,
(点击代码 -> 首选项 -> 设置)
Press Command + ,
(Click Code -> Preferences -> Settings)
滚动到'Executatble Path
'并输入
/Users/your-username/.composer/vendor/bin/phpcs
/Users/your-username/.composer/vendor/bin/phpcs
这为我解决了问题,我希望它也适用于您.干杯!
This fixed the issue for me, I hope it does for you too. Cheers!
这篇关于Visual Studio Code:无法找到 phpcs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!