Skip to content
Advertisement

PHP CodeSniffer Error: The phpcs report contains invalid json

I want to add PHP CodeSniffer to VScode.

Within VScode I am getting the error ‘phpcs: The phpcs report contains invalid json’

However when I run the following command in the terminal:

JavaScript

PHP Codesniffer works as expected with the following terminal output:

JavaScript

There is no invalid JSON in the output and I am unsure how to proceed to get this working.

Advertisement

Answer

In this case I had the wrong executable path for phpcs. Running which phpcs in the terminal gave me the correct path.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement