phpcs: Unable to locate phpcs. Invalid version string encountered!

See original GitHub issue

mac system

install phpcs via composer global require squizlabs/php_codesniffer

open vscode

installed phpcs extention

config it

exepath /Users/usernama/.composer/vendor/squizlabs/php_codesniffer/bin/phpcs

show that

phpcs: Unable to locate phpcs. Invalid version string encountered!

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:5

github_iconTop GitHub Comments

4reactions
needrunningcommented, Oct 29, 2019

I have solved it via install PHP CodeSniffe on my system phpcs

https://www.jianshu.com/p/8c16b1f247ed phpcs

1reaction
davisbencommented, Jan 9, 2021

In my case, I’m getting this error because of a PHP deprecation notice that is output when phpcs --version is run. The regex expects the output of that command to start with PHP_CodeSniffer version, followed by the version number, but the deprecation notice is printed before that, causing the version to not be matched.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unable to locate phpcs. Invalid version string encountered! #115
I am using phpcs 3.5 but you should try this too no matter the version. Really, this issue (of phpcs running in the...
Read more >
Visual Studio Code: Unable to locate phpcs - Stack Overflow
So, to fix this: First, run the command phpcs --version and check if the command does not print any warning or error before...
Read more >
[SOLVED] Unable to locate phpcs. Please add ... - Robert Askam
Restart your Visual Studio Code and you should now not get the error: phpcs: Unable to locate phpcs. Please add phpcs to your...
Read more >
unable to locate phpcs. invalid version string encountered!
Plugin Installation. Open Visual Studio Code. Press Ctrl+P on Windows or Cmd+P on Mac to open the Quick Open dialog. Type ext install...
Read more >
Unable to locate phpcs. Invalid version string encountered!
phpcs : Unable to locate phpcs. Invalid version string encountered! ... install phpcs via composer global require squizlabs/php_codesniffer.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found