Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Error running PHPCS TypeError: Invalid Version: undefined #462

Open
andy-preston opened this issue Oct 17, 2020 · 7 comments
Open

Error running PHPCS TypeError: Invalid Version: undefined #462

andy-preston opened this issue Oct 17, 2020 · 7 comments
Labels

Comments

@andy-preston
Copy link

I'm getting the following message in my Atom console ever time I try to run linter-phpcs

I assume it's got something to do with Atom's continuous changing of the linter API???

/home/andyp/.atom/packages/linter/dist/index.js:1 [Linter] Error running PHPCS TypeError: Invalid Version: undefined
at new SemVer (/home/andyp/.atom/packages/linter-eslint/node_modules/semver/semver.js:314)
at compare (/home/andyp/.atom/packages/linter-eslint/node_modules/semver/semver.js:647)
at Function.gte (/home/andyp/.atom/packages/linter-eslint/node_modules/semver/semver.js:703)
at Object. (/home/andyp/.atom/packages/linter-phpcs/lib/main.js:224)
at Generator.next ()
at step (/home/andyp/.atom/packages/linter-phpcs/lib/main.js:5)
(anonymous) @ /home/andyp/.atom/packages/linter/dist/index.js:1
/home/andyp/.atom/packages/php-cs-fixer/lib/php-cs-fixer.coffee:240 php exited with code: 0

@markb-wa
Copy link

Can confirm that I am seeing the same behaviour.

Screenshot 2020-10-20 at 16 54 02

@UziTech
Copy link
Member

UziTech commented Mar 31, 2021

Can you share your linter-phpcs settings and the output of phpcs --version in a terminal?

@markb-wa
Copy link

Certainly.

Output of phpcs --version:
Screenshot 2021-03-31 at 09 05 40

linter-phpcs setings:
Screenshot 2021-03-31 at 09 08 57
Screenshot 2021-03-31 at 09 08 31
Screenshot 2021-03-31 at 09 08 43

And for reference:
Screenshot 2021-03-31 at 09 16 52

@UziTech
Copy link
Member

UziTech commented Mar 31, 2021

Can you update to the latest version and provide the error if it is still happening?

@andy-preston
Copy link
Author

Screenshots are a really unhelpful way of sharing information.

@UziTech
Copy link
Member

UziTech commented Mar 31, 2021

It looks like the error comes from not being able to parse the phpcs version from the executable listed in the Executable Path setting.

I just released a new version (v1.8.1) that might provide a better error with more information that might be helpful.

If this happens again please share the error thrown. It should be something like:
Cannot parse PHPCS version for {Executable Path}: '{version output}'

@markb-wa
Copy link

Can you update to the latest version and provide the error if it is still happening?

Have updated to the latest, and so far so good. Will update if I see the error recur.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants