Closed JustBlackBird closed 8 years ago
It seems that the problem is in files extensions.
As I see, composer creates vendor\bin\phpcs.bat
on windows instead of just vendor\bin\phpcs
. Normally windows cmd resolves command.bat
to command
. At the same time, node.js child_process.spawn
does not use shell to spawn PHPCS process, so no resolving is done.
As a temporary workaround you can specify .\\vendor\\bin\\phpcs.bat
as bin
option.
This is the same issue I was having with 'PHPcs encoding issue #10'
For some reason, the error was outputting with incorrect coding, and therefore unreadable. I was assuming it was an encoding error with this plugin. Since PHPCS worked fine from CLI in windows and CLI / gulp via Homestead.
Well, the problem described in the issue is not only in slash styles. It's most about resolving command path without running subshell (subshell is spawned by node.js child_process.exec
but not with child_process.spawn
).
Frankly, i don't see a way to fix the problem right now.
I'm having this issue as well. My installation of phpcs is on my C: while my development stuff is on D:. My php directory is the path so setting bin: 'phpcs.bat'
worked for me to fix it. It's something on Microsoft's end which will hopefully be fixed with Windows 10 getting BASH soon.
I'm not sure what your problem exactly is but setting full path as bin
option should help.
It's the same issue of phpcs.bat
not being resolved as phpcs
when gulp. In a normal command prompt, it works fine with phpcs {filename}
, but with gulp I get "Cannot find phpcs".
At the moment i'm waiting for https://github.com/npm/node-which/issues/29 and https://github.com/npm/node-which/issues/26 to be resolved to rewrite gulp-phpcs bin finder logic.
Fixed in v1.1.0
Each of these
bin
option values./vendor/bin/phpcs
.\\vendor\\bin\\phpcs
vendor/bin/phpcs
end with
Error: Cannot find
error on Windows.Directory structure:
Gulp code:
Results:
Using gulp-phpcs 1.0.0