{"action":"created","issue":{"url":"https://api.github.com/repos/composer/composer/issues/5045","repository_url":"https://api.github.com/repos/composer/composer","labels_url":"https://api.github.com/repos/composer/composer/issues/5045/labels{/name}","comments_url":"https://api.github.com/repos/composer/composer/issues/5045/comments","events_url":"https://api.github.com/repos/composer/composer/issues/5045/events","html_url":"https://github.com/composer/composer/issues/5045","id":140178764,"number":5045,"title":"Composer can't find commands from vendor/bin on windows","user":{"login":"Nayjest","id":153999,"avatar_url":"https://avatars.githubusercontent.com/u/153999?v=3","gravatar_id":"","url":"https://api.github.com/users/Nayjest","html_url":"https://github.com/Nayjest","followers_url":"https://api.github.com/users/Nayjest/followers","following_url":"https://api.github.com/users/Nayjest/following{/other_user}","gists_url":"https://api.github.com/users/Nayjest/gists{/gist_id}","starred_url":"https://api.github.com/users/Nayjest/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nayjest/subscriptions","organizations_url":"https://api.github.com/users/Nayjest/orgs","repos_url":"https://api.github.com/users/Nayjest/repos","events_url":"https://api.github.com/users/Nayjest/events{/privacy}","received_events_url":"https://api.github.com/users/Nayjest/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2016-03-11T13:05:01Z","updated_at":"2016-03-13T16:36:35Z","closed_at":null,"body":"### Overview\r\nWhen running  commands defined in \"scripts\" section from vendor/bin via `composer <command>` on windows, composer can't find it.\r\n\r\n### Environment\r\n**OS:** Windows 7\r\n**PHP:** php 5.6.12\r\n**Composer**:  \r\n* 1.0-dev (8bf46768f3f5397c259b77321b2e887a53624adb) 2016-03-10 16:31:09 installed locally (.phar)\r\n* 1.0-dev (1dce6442ed2518855d096d1123f04472d9b6f764) 2016-03-11 10:30:26 installed globally via ComposerSetup.exe\r\n\r\n\r\n\r\n### Steps to reproduce\r\n1. Create composer package\r\n2. Add package that has scripts in \"bin\" section of its composer.json to dependencies (I used phpunit)\r\n```javascript\r\n\"require\": {\r\n    \"phpunit/phpunit\": \"^4||^5\"\r\n}\r\n```\r\n3. Install dependencies\r\n4. Define command in composer.json of created package\r\n```javascript\r\n\"scripts\": {\r\n       \"test\": \"phpunit\"\r\n}\r\n```\r\n5. Run command (`php composer.phar test -vvv` in my example)\r\n\r\n### Expected result\r\nCommand is executed\r\n\r\n### Actual result\r\nphpunit command is not found\r\n\r\n##### Output example\r\n```\r\nC:\\Users\\Vitaliy Stepanenko\\Dropbox\\!CODE\\lib\\testing-helpers>php composer.phar test -vvv\r\nReading ./composer.json\r\nLoading config file C:/Users/Vitaliy Stepanenko/AppData/Roaming/Composer/config.json\r\nLoading config file C:/Users/Vitaliy Stepanenko/AppData/Roaming/Composer/auth.json\r\nLoading config file ./composer.json\r\nChecking CA file C:\\Users\\Vitaliy Stepanenko\\AppData\\Local\\Temp\\composer-cacert-39eaf16e26c08cc90d728865f1c60406ee5d864d5963\r\nf72ede2a1cbb127f95ca.pem\r\nExecuting command (C:\\Users\\Vitaliy Stepanenko\\Dropbox\\!CODE\\lib\\testing-helpers): git branch --no-color --no-abbrev -v\r\nFailed to initialize global composer: Composer could not find the config file: C:/Users/Vitaliy Stepanenko/AppData/Roaming/C\r\nomposer/composer.json\r\nTo initialize a project, please create a composer.json file as described in the https://getcomposer.org/ \"Getting Started\" s\r\nection\r\nReading C:\\Users\\Vitaliy Stepanenko\\Dropbox\\!CODE\\lib\\testing-helpers/vendor/composer/installed.json\r\n> test: phpunit\r\nExecuting command (CWD): phpunit\r\n\"phpunit\" не является внутренней или внешней\r\nкомандой, исполняемой программой или пакетным файлом.\r\nScript phpunit handling the test event returned with an error\r\n\r\n\r\n  [RuntimeException]\r\n  Error Output: \"phpunit\" не является внутренней или внешней\r\n  командой, исполняемой программой или пакетным файлом.\r\n\r\n\r\nException trace:\r\n () at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpers/composer.phar/src/Composer/EventDispatcher/Event\r\nDispatcher.php:204\r\n Composer\\EventDispatcher\\EventDispatcher->doDispatch() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-help\r\ners/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:94\r\n Composer\\EventDispatcher\\EventDispatcher->dispatchScript() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-\r\nhelpers/composer.phar/src/Composer/Command/ScriptAliasCommand.php:59\r\n Composer\\Command\\ScriptAliasCommand->execute() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpers/comp\r\noser.phar/vendor/symfony/console/Command/Command.php:259\r\n Symfony\\Component\\Console\\Command\\Command->run() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpers/co\r\nmposer.phar/vendor/symfony/console/Application.php:844\r\n Symfony\\Component\\Console\\Application->doRunCommand() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpe\r\nrs/composer.phar/vendor/symfony/console/Application.php:192\r\n Symfony\\Component\\Console\\Application->doRun() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpers/comp\r\noser.phar/src/Composer/Console/Application.php:166\r\n Composer\\Console\\Application->doRun() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpers/composer.phar\r\n/vendor/symfony/console/Application.php:123\r\n Symfony\\Component\\Console\\Application->run() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpers/compos\r\ner.phar/src/Composer/Console/Application.php:99\r\n Composer\\Console\\Application->run() at phar://C:/Users/Vitaliy Stepanenko/Dropbox/!CODE/lib/testing-helpers/composer.phar/b\r\nin/composer:43\r\n require() at C:\\Users\\Vitaliy Stepanenko\\Dropbox\\!CODE\\lib\\testing-helpers\\composer.phar:25\r\n\r\ntest [--dev] [--no-dev] [--] [<args>]...\r\n\r\n```\r\n### Additional notes:\r\nIf I specify command as \"vendor\\\\\\\\bin\\\\\\\\phpunit\" it works, but not for unix, \"vendor/bin/phpunit\" does not works for windows. So the only way to specify command that will work for both windows and unix is \"php vendor/phpunit/phpunit/phpunit\" but I have no guarantee that vendor will keep this file in same place in further releases becouse it's not designed to be used this way.\r\n"},"comment":{"url":"https://api.github.com/repos/composer/composer/issues/comments/195991402","html_url":"https://github.com/composer/composer/issues/5045#issuecomment-195991402","issue_url":"https://api.github.com/repos/composer/composer/issues/5045","id":195991402,"user":{"login":"rquadling","id":12801,"avatar_url":"https://avatars.githubusercontent.com/u/12801?v=3","gravatar_id":"","url":"https://api.github.com/users/rquadling","html_url":"https://github.com/rquadling","followers_url":"https://api.github.com/users/rquadling/followers","following_url":"https://api.github.com/users/rquadling/following{/other_user}","gists_url":"https://api.github.com/users/rquadling/gists{/gist_id}","starred_url":"https://api.github.com/users/rquadling/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rquadling/subscriptions","organizations_url":"https://api.github.com/users/rquadling/orgs","repos_url":"https://api.github.com/users/rquadling/repos","events_url":"https://api.github.com/users/rquadling/events{/privacy}","received_events_url":"https://api.github.com/users/rquadling/received_events","type":"User","site_admin":false},"created_at":"2016-03-13T16:36:35Z","updated_at":"2016-03-13T16:36:35Z","body":"I've added ``.\\vendor\\bin`` to my path for Windows. Should work for you. "}}