Fatal error: Uncaught Error: Class 'PHP_CodeSniffer\Runner' not found
laraws opened this issue · comments
When I use command to exec phpcs, erros displays like this:
root@7be0c6dcae4e:/var/www# ./vendor/bin/phpcs
Fatal error: Uncaught Error: Class 'PHP_CodeSniffer\Runner' not found in /var/www/vendor/bin/phpcs on line 17
Error: Class 'PHP_CodeSniffer\Runner' not found in /var/www/vendor/bin/phpcs on line 17
Call Stack:
0.0002 391536 1. {main}() /var/www/vendor/bin/phpcs:0
Try execute command composer install
before.
Try execute command
composer install
before.
I have tried it, but it doesn't work.
try vendor/bin/phpcs
or php vendor/bin/phpcs
Hey @laraws could please tell the steps you did before running this? Are you using Docker? What output did composer install
show?
Hey @laraws could please tell the steps you did before running this? Are you using Docker? What output did
composer install
show?
It solved after I ran the composer update
. It may be a format problem. I copied the project from the GCP Ubuntu instance before I did . /vendor/bin/phpcs.
. I'm using docker with PHP environment.
Delete /vendor
and composer.lock
, and rerun composer install