{"action":"created","issue":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/2214","repository_url":"https://api.github.com/repos/yarnpkg/yarn","labels_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2214/labels{/name}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2214/comments","events_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2214/events","html_url":"https://github.com/yarnpkg/yarn/issues/2214","id":194774111,"number":2214,"title":"yarn doesn't install packages properly, sometimes links to cache","user":{"login":"mgol","id":1758366,"avatar_url":"https://avatars.githubusercontent.com/u/1758366?v=3","gravatar_id":"","url":"https://api.github.com/users/mgol","html_url":"https://github.com/mgol","followers_url":"https://api.github.com/users/mgol/followers","following_url":"https://api.github.com/users/mgol/following{/other_user}","gists_url":"https://api.github.com/users/mgol/gists{/gist_id}","starred_url":"https://api.github.com/users/mgol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mgol/subscriptions","organizations_url":"https://api.github.com/users/mgol/orgs","repos_url":"https://api.github.com/users/mgol/repos","events_url":"https://api.github.com/users/mgol/events{/privacy}","received_events_url":"https://api.github.com/users/mgol/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-10T15:30:55Z","updated_at":"2017-01-19T22:28:18Z","closed_at":null,"body":"<!-- *Before creating an issue please make sure you are using the latest version of yarn.* -->\r\n\r\n**Do you want to request a *feature* or report a *bug*?**\r\n<!-- Is the feature a substantial feature request? Please use https://github.com/yarnpkg/rfcs -->\r\n\r\nA bug.\r\n\r\n**What is the current behavior?**\r\n`yarn` sometimes doesn't install packages correctly:\r\n1. Some packages have almost empty directories, containin just the `node_modules` folder and that's it.\r\n2. Some binaries link to the yarn cache instead of locally installed packages.\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n<!-- If you can, provide a link to a public repository which contains the files necessary to reproduce this. -->\r\n\r\nWith the following package.json:\r\n```json\r\n{\r\n  \"name\": \"test-package\",\r\n  \"private\": true,\r\n  \"dependencies\": {\r\n    \"autoprefixer\": \"6.5.3\",\r\n    \"babel-core\": \"6.20.0\",\r\n    \"babel-loader\": \"6.2.9\",\r\n    \"babel-plugin-lodash\": \"3.2.10\",\r\n    \"babel-plugin-transform-runtime\": \"6.15.0\",\r\n    \"babel-preset-es2015\": \"6.18.0\",\r\n    \"babel-preset-es2016\": \"6.16.0\",\r\n    \"babel-preset-es2017\": \"6.16.0\",\r\n    \"chalk\": \"1.1.3\",\r\n    \"css-loader\": \"0.26.1\",\r\n    \"directory-tree\": \"1.1.1\",\r\n    \"eslint\": \"3.12.0\",\r\n    \"eslint-config-mgol\": \"0.0.34\",\r\n    \"eslint-loader\": \"1.6.1\",\r\n    \"extract-text-webpack-plugin\": \"1.0.1\",\r\n    \"file-loader\": \"0.9.0\",\r\n    \"html-webpack-harddisk-plugin\": \"0.0.2\",\r\n    \"html-webpack-plugin\": \"2.24.1\",\r\n    \"jquery\": \"3.1.1\",\r\n    \"json-loader\": \"0.5.4\",\r\n    \"koa\": \"1.2.4\",\r\n    \"koa-compress\": \"1.0.9\",\r\n    \"koa-etag\": \"2.1.1\",\r\n    \"koa-fresh\": \"0.0.3\",\r\n    \"koa-hbs\": \"0.9.0\",\r\n    \"koa-router\": \"5.4.0\",\r\n    \"koa-static-cache\": \"3.1.7\",\r\n    \"lodash\": \"4.17.2\",\r\n    \"node-sass\": \"3.13.1\",\r\n    \"postcss-loader\": \"1.2.0\",\r\n    \"sass-loader\": \"4.0.2\",\r\n    \"semver\": \"5.3.0\",\r\n    \"style-loader\": \"0.13.1\",\r\n    \"supports-color\": \"3.1.2\",\r\n    \"url-loader\": \"0.5.7\",\r\n    \"webpack\": \"1.14.0\"\r\n  },\r\n  \"devDependencies\": {\r\n    \"browser-sync\": \"2.18.2\",\r\n    \"concurrently\": \"3.1.0\",\r\n    \"nodemon\": \"1.11.0\",\r\n    \"webpack-dev-middleware\": \"1.8.4\",\r\n    \"webpack-hot-middleware\": \"2.13.2\"\r\n  }\r\n}\r\n```\r\nFire `yarn cache clean && yarn` and then `./node_modules/.bin/concurrently`. You'll get a message \"Error: Cannot find module 'rx'\". `rx` is a dependency of the `concurrently` package so it's weird that it's not installed. But look into `./node_modules/concurrently` - it only contains `node_modules` and none files. Moreover, `./node_modules/concurrently/node_modules` only contains `supports-color`; no `rx` here but also not under `./node_modules/rx` so it's complaining correctly.\r\n\r\nWhy does the command even start then, since the package folder is almost empty? Let's look into `./node_modules/.bin`:\r\n```\r\nbrowser-sync@ -> ../../../../../../Library/Caches/Yarn/npm-browser-sync-2.18.2-3c101274c507e2f734dbce4e4b19bd3e124c3ea7/bin/browser-sync.js\r\nconcurrent@ -> ../../../../../../Library/Caches/Yarn/npm-concurrently-3.1.0-dc5ef0459090012604756668894c04b434ef90d1/src/main.js\r\nconcurrently@ -> ../../../../../../Library/Caches/Yarn/npm-concurrently-3.1.0-dc5ef0459090012604756668894c04b434ef90d1/src/main.js\r\neslint@ -> ../eslint/bin/eslint.js\r\nnode-sass@ -> ../node-sass/bin/node-sass\r\nnodemon@ -> ../../../../../../Library/Caches/Yarn/npm-nodemon-1.11.0-226c562bd2a7b13d3d7518b49ad4828a3623d06c/bin/nodemon.js\r\nsemver@ -> ../semver/bin/semver\r\nwebpack@ -> ../webpack/bin/webpack.js\r\n```\r\n\r\nAs you can see, some packages are taken from the yarn cache instead of the local location.\r\n\r\n**What is the expected behavior?**\r\n1. It should work.\r\n2. None binaries should be linked to the yarn cache, everything should exist locally.\r\n\r\n**Please mention your node.js, yarn and operating system version.**\r\nNode 6.9.2, yarn 0.17.10 (installed via Homebrew), macOS 10.12.1 (16B2555)"},"comment":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/comments/273919021","html_url":"https://github.com/yarnpkg/yarn/issues/2214#issuecomment-273919021","issue_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2214","id":273919021,"user":{"login":"jeffnappi","id":393868,"avatar_url":"https://avatars.githubusercontent.com/u/393868?v=3","gravatar_id":"","url":"https://api.github.com/users/jeffnappi","html_url":"https://github.com/jeffnappi","followers_url":"https://api.github.com/users/jeffnappi/followers","following_url":"https://api.github.com/users/jeffnappi/following{/other_user}","gists_url":"https://api.github.com/users/jeffnappi/gists{/gist_id}","starred_url":"https://api.github.com/users/jeffnappi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jeffnappi/subscriptions","organizations_url":"https://api.github.com/users/jeffnappi/orgs","repos_url":"https://api.github.com/users/jeffnappi/repos","events_url":"https://api.github.com/users/jeffnappi/events{/privacy}","received_events_url":"https://api.github.com/users/jeffnappi/received_events","type":"User","site_admin":false},"created_at":"2017-01-19T22:28:18Z","updated_at":"2017-01-19T22:28:18Z","body":"Also seeing this sporatically with our CircleCI builds."}}
{"actor":{"display_login":"jeffnappi"}}