Reputation: 7338
My configuration / steps to reproduce the error:
composer global require friendsofphp/php-cs-fixer
C:\Users\khalil\AppData\Roaming\Composer\vendor\bin\php-cs-fixer
Output: Version: PHP CS Fixer 2.11.1 Grey Devil by Fabien Potencier and Dariusz Ruminski
Still getting the error:
PHP CS Fixer: spawn php-cs-fixer ENOENT. executablePath not found
Note: I am on Windows 10 64bit
Upvotes: 3
Views: 6441
Reputation: 4266
With Windows 10 & VS Code, You can use:
Install Composer global & see: https://github.com/FriendsOfPHP/PHP-CS-Fixer#installation
Add C:\Users{My Username}\AppData\Roaming\Composer\vendor\bin to PATH in System environment
Use config:
"php-cs-fixer.executablePath": "php-cs-fixer",
"php-cs-fixer.executablePathWindows": "php-cs-fixer.bat",
Upvotes: 0
Reputation: 3185
This is what worked out for me on Windows 10, modify if you have different folder structure.
"phpcbf.executablePath": "C:\\Users\\User\\AppData\\Roaming\\Composer\\vendor\\bin\\phpcbf.bat",
"phpcbf.executablePathWindows": "C:\\Users\\User\\AppData\\Roaming\\Composer\\vendor\\bin\\phpcbf.bat"
I am using phpcbf
extension but yours is probably something like
"php-cs-fixer.executablePath": "C:\\Users\\User\\AppData\\Roaming\\Composer\\vendor\\bin\\php-cs-fixer.phar",
"php-cs-fixer.executablePathWindows": "C:\\Users\\User\\AppData\\Roaming\\Composer\\vendor\\bin\\php-cs-fixer.bat",
Upvotes: 1