Closed fangspeen closed 9 years ago
From the error message, it seems that it's using the default path. Can you try putting phpcs
binary in /usr/bin/
?
I get the same error on Windows 8.1. What can I do?
Ok, the solution is simple: you have to set this as executablePath: C:\xampp\php\phpcs.bat
Glad you found the fix.
I get this exact error message on Linux. Here’s my config.cson
:
"*":
welcome:
showOnStartup: false
linter: {}
"linter-php":
phpExcecutablePath: "/usr/bin/php"
"linter-phpcs":
phpcsExecutablePath: "/home/jonny/.composer/vendor/bin/phpcs"
ignore: "*.blade.php,*.twig.php"
"linter-phpmd":
phpmdExecutablePath: "/home/jonny/.composer/vendor/bin/phpmd"
rulesets: "cleancode,codesize,controversial,design,naming,unusedcode,laravel"
core: {}
editor:
invisibles: {}
Indeed opening a terminal and typing in phpcs --version
works given /home/jonny/.composer/vendor/bin
is in my $PATH
.
So how can I get this workking?
@jonnybarnes it's actually a node's internal error that it throws when the executable was not found or didn't have +x
chmod or isn't readable at all.
But I can type phpcs --standard=PSR2 /path/to/project/file.php
and it works?
So why can’t node find it?
It's a known bug with OSX, and actually comes from node. If you spawn atom from CLI You'll see that it works, but when you run it from applications, You'll have to enter phpcs path in the config explicitally
I'm using atom on Linux. I'll try running it from the CLI.
How have you extended your $PATH
?
Starting it from the shell indeed allows atom(/node) to use phpcs.
I use ZSH, the last line of my .zshrc
file is export PATH="$PATH:/home/jonny/.bin:/home/jonny/.composer/vendor/bin"
spawn phpcs ENOENT Error: spawn phpcs ENOENT at exports._errnoException (util.js:734:11) at Process.ChildProcess._handle.onexit (child_process.js:1035:32) at child_process.js:1127:20 at process._tickCallback (node.js:357:13)
I get this error or variations of it when I alter the executable path I have checked and rechecked the path...