I had a similar issue. was using this document to install php code sniffer for drupal.
Installing Coder Sniffer
did the following step
phpcs --config-set installed_paths /home/dld/vendor/drupal/coder/coder_sniffer
Using config file: /home/dld/vendor/squizlabs/php_codesniffer/CodeSniffer.conf
Config value "installed_paths" updated successfully; old value was "../../drupal/coder/coder_sniffer,../../sirbrillig/phpcs-variable-analysis,../../slevomat/coding-standard"
and then tried running it on drupal module file
it gave the following message
drupalcs hello_world.module
ERROR: Referenced sniff "SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator" does not exist
Hence i did the following to fix it.
phpcs --config-set installed_paths ../../drupal/coder/coder_sniffer,../../sirbrillig/phpcs-variable-analysis,../../slevomat/coding-standard,/home/dld/vendor/drupal/coder/coder_snifferUsing config file: /home/dld/vendor/squizlabs/php_codesniffer/CodeSniffer.conf
Config value "installed_paths" updated successfully; old value was "/home/dld/vendor/drupal/coder/coder_sniffer"
then
drupalcs hello_world.module
worked perfectly fine.