{"action":"closed","issue":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/6493","repository_url":"https://api.github.com/repos/yarnpkg/yarn","labels_url":"https://api.github.com/repos/yarnpkg/yarn/issues/6493/labels{/name}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/issues/6493/comments","events_url":"https://api.github.com/repos/yarnpkg/yarn/issues/6493/events","html_url":"https://github.com/yarnpkg/yarn/issues/6493","id":366996158,"node_id":"MDU6SXNzdWUzNjY5OTYxNTg=","number":6493,"title":"Yarn run doesn't find bin scripts when using Plug and Play on Windows","user":{"login":"edmorley","id":501702,"node_id":"MDQ6VXNlcjUwMTcwMg==","avatar_url":"https://avatars3.githubusercontent.com/u/501702?v=4","gravatar_id":"","url":"https://api.github.com/users/edmorley","html_url":"https://github.com/edmorley","followers_url":"https://api.github.com/users/edmorley/followers","following_url":"https://api.github.com/users/edmorley/following{/other_user}","gists_url":"https://api.github.com/users/edmorley/gists{/gist_id}","starred_url":"https://api.github.com/users/edmorley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edmorley/subscriptions","organizations_url":"https://api.github.com/users/edmorley/orgs","repos_url":"https://api.github.com/users/edmorley/repos","events_url":"https://api.github.com/users/edmorley/events{/privacy}","received_events_url":"https://api.github.com/users/edmorley/received_events","type":"User","site_admin":false},"labels":[{"id":1086317955,"node_id":"MDU6TGFiZWwxMDg2MzE3OTU1","url":"https://api.github.com/repos/yarnpkg/yarn/labels/plugnplay","name":"plugnplay","color":"9be87a","default":false},{"id":594046112,"node_id":"MDU6TGFiZWw1OTQwNDYxMTI=","url":"https://api.github.com/repos/yarnpkg/yarn/labels/triaged","name":"triaged","color":"c5def5","default":false}],"state":"closed","locked":false,"assignee":{"login":"rally25rs","id":38535,"node_id":"MDQ6VXNlcjM4NTM1","avatar_url":"https://avatars3.githubusercontent.com/u/38535?v=4","gravatar_id":"","url":"https://api.github.com/users/rally25rs","html_url":"https://github.com/rally25rs","followers_url":"https://api.github.com/users/rally25rs/followers","following_url":"https://api.github.com/users/rally25rs/following{/other_user}","gists_url":"https://api.github.com/users/rally25rs/gists{/gist_id}","starred_url":"https://api.github.com/users/rally25rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rally25rs/subscriptions","organizations_url":"https://api.github.com/users/rally25rs/orgs","repos_url":"https://api.github.com/users/rally25rs/repos","events_url":"https://api.github.com/users/rally25rs/events{/privacy}","received_events_url":"https://api.github.com/users/rally25rs/received_events","type":"User","site_admin":false},"assignees":[{"login":"rally25rs","id":38535,"node_id":"MDQ6VXNlcjM4NTM1","avatar_url":"https://avatars3.githubusercontent.com/u/38535?v=4","gravatar_id":"","url":"https://api.github.com/users/rally25rs","html_url":"https://github.com/rally25rs","followers_url":"https://api.github.com/users/rally25rs/followers","following_url":"https://api.github.com/users/rally25rs/following{/other_user}","gists_url":"https://api.github.com/users/rally25rs/gists{/gist_id}","starred_url":"https://api.github.com/users/rally25rs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rally25rs/subscriptions","organizations_url":"https://api.github.com/users/rally25rs/orgs","repos_url":"https://api.github.com/users/rally25rs/repos","events_url":"https://api.github.com/users/rally25rs/events{/privacy}","received_events_url":"https://api.github.com/users/rally25rs/received_events","type":"User","site_admin":false}],"milestone":null,"comments":13,"created_at":"2018-10-04T22:37:25Z","updated_at":"2018-11-15T14:16:51Z","closed_at":"2018-11-15T14:16:51Z","author_association":"CONTRIBUTOR","body":"**Do you want to request a *feature* or report a *bug*?**\r\nBug\r\n\r\n**What is the current behavior?**\r\n`yarn run` fails to find packages' bin scripts when using plug and play mode on Windows, instead giving:\r\n\r\n```\r\nC:\\Users\\Ed\\src\\testcase-yarn-pnp-windows>yarn lint\r\nyarn run v1.12.0\r\nwarning package.json: No license field\r\n$ eslint --version\r\n'eslint' is not recognized as an internal or external command,\r\noperable program or batch file.\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\n```\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n1. Create an empty directory containing this `package.json`:\r\n```json\r\n{\r\n  \"installConfig\": {\r\n    \"pnp\": true\r\n  },\r\n  \"dependencies\": {\r\n    \"eslint\": \"^5.6.1\"\r\n  },\r\n  \"scripts\": {\r\n    \"lint\": \"eslint --version\"\r\n  }\r\n}\r\n```\r\n2. `yarn --pnp`\r\n3. `yarn lint`\r\n\r\n**What is the expected behavior?**\r\nESLint is found and outputs its version.\r\n\r\n**Please mention your node.js, yarn and operating system version.**\r\nYarn 1.12.0, Node 10.11.0, Windows 10 x64\r\n\r\n**Other:**\r\n* This reproduced for me inside both an MSYS2 bash shell and when using native `cmd.exe`\r\n* The same error occurred using something other than eslint (eg jest)\r\n* If instead of running `yarn lint`, I call the package directly (ie not a `scripts` command), I get a more informative error message:\r\n```\r\nyarn eslint --version\r\nyarn run v1.12.0\r\nwarning package.json: No license field\r\n$ C:\\Users\\Ed\\AppData\\Local\\Yarn\\Cache\\v3\\npm-eslint-5.6.1-348134e32ccc09abb2df1bf282b3f6eed8c7b480\\node_modules\\eslint\\.bin\\eslint --version\r\n'C:\\Users\\Ed\\AppData\\Local\\Yarn\\Cache\\v3\\npm-eslint-5.6.1-348134e32ccc09abb2df1bf282b3f6eed8c7b480\\node_modules\\eslint\\.bin\\eslint'\r\nis not recognized as an internal or external command, operable program or batch file.\r\nerror Command failed with exit code 1.\r\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\r\n```\r\n* Inspecting the contents of the `.bin` directory in that error message, shows `eslint` to be a junction (so related to #6450? Though that issue doesn't appear to be about PnP):\r\n```\r\n01/10/2018  17:11    <JUNCTION>     eslint [C:\\Users\\Ed\\AppData\\Local\\Yarn\\Cache\\v3\\npm-eslint-5.6.1-348134e32ccc09abb2df1bf282b3f6eed8c7b480\\node_modules\\eslint\\bin\\eslint.js]\r\n```\r\n* Trying to open the junction in Windows Explorer gives:\r\n```\r\nC:\\Users\\Ed\\AppData\\Local\\Yarn\\Cache\\v3\\npm-eslint-5.6.1-348134e32ccc09abb2df...\\eslint\r\nis not accessible.\r\n\r\nThe directory name is invalid.\r\n```\r\n* MSYS2 reports it as a symlink to a non-existent directory rather than a file (note the trailing slash):\r\n```\r\nlrwxrwxrwx 1 Ed None 132 Oct  1 17:11 eslint -> /c/Users/Ed/AppData/Local/Yarn/Cache/v3/npm-eslint-5.6.1-348134e32ccc09abb2df1bf282b3f6eed8c7b480/node_modules/eslint/bin/eslint.js/\r\n```"}}
{"actor":{"display_login":"edmorley"}}