{"action":"created","issue":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/2238","repository_url":"https://api.github.com/repos/yarnpkg/yarn","labels_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2238/labels{/name}","comments_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2238/comments","events_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2238/events","html_url":"https://github.com/yarnpkg/yarn/issues/2238","id":195183284,"number":2238,"title":"Yarn deletes contents of symlinked directories on install","user":{"login":"mariusmarais","id":73371,"avatar_url":"https://avatars1.githubusercontent.com/u/73371?v=4","gravatar_id":"","url":"https://api.github.com/users/mariusmarais","html_url":"https://github.com/mariusmarais","followers_url":"https://api.github.com/users/mariusmarais/followers","following_url":"https://api.github.com/users/mariusmarais/following{/other_user}","gists_url":"https://api.github.com/users/mariusmarais/gists{/gist_id}","starred_url":"https://api.github.com/users/mariusmarais/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mariusmarais/subscriptions","organizations_url":"https://api.github.com/users/mariusmarais/orgs","repos_url":"https://api.github.com/users/mariusmarais/repos","events_url":"https://api.github.com/users/mariusmarais/events{/privacy}","received_events_url":"https://api.github.com/users/mariusmarais/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-12-13T07:44:54Z","updated_at":"2018-04-01T21:52:28Z","closed_at":"2017-03-14T09:17:04Z","author_association":"NONE","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_bug_\r\n\r\n**What is the current behavior?**\r\nSymlinks manually created in `node_modules` disappear when running `yarn install`. This is fine.\r\nHowever, it isn't just the symlink that gets deleted, but the entire contents of the directory that the symlink pointed to. Ouch.\r\n\r\n**If the current behavior is a bug, please provide the steps to reproduce.**\r\n  1. In a package, create a symlink, `node_modules/the_link`, pointing to `/some/path/directory` with some backed-up files in it. \r\n  2. Run `yarn install`\r\n  3. See `node_modules/the_link` is gone -- expected behavior.\r\n  4. See `some/path/directory` is now empty -- not expected.\r\n\r\n**What is the expected behavior?**\r\nOnly the symlink should be deleted.\r\n\r\n**Background**\r\nWe're using this workflow in a monorepo to easily develop on packages.  This is different from the `yarn link` workflow, because the links are always in place, not every once in a while.  Currently we're fine with a gulp script to recreate them after `yarn install`, but losing changes is unacceptable.  Other issues like #1214 and constantly using cached `file:` packages prevent using other options.\r\n\r\n**Please mention your node.js, yarn and operating system version.**\r\nyarn: 0.17.10\r\nnode: 4.3.2\r\nosx: 10.12.1"},"comment":{"url":"https://api.github.com/repos/yarnpkg/yarn/issues/comments/377819564","html_url":"https://github.com/yarnpkg/yarn/issues/2238#issuecomment-377819564","issue_url":"https://api.github.com/repos/yarnpkg/yarn/issues/2238","id":377819564,"user":{"login":"zubko","id":16039,"avatar_url":"https://avatars1.githubusercontent.com/u/16039?v=4","gravatar_id":"","url":"https://api.github.com/users/zubko","html_url":"https://github.com/zubko","followers_url":"https://api.github.com/users/zubko/followers","following_url":"https://api.github.com/users/zubko/following{/other_user}","gists_url":"https://api.github.com/users/zubko/gists{/gist_id}","starred_url":"https://api.github.com/users/zubko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zubko/subscriptions","organizations_url":"https://api.github.com/users/zubko/orgs","repos_url":"https://api.github.com/users/zubko/repos","events_url":"https://api.github.com/users/zubko/events{/privacy}","received_events_url":"https://api.github.com/users/zubko/received_events","type":"User","site_admin":false},"created_at":"2018-04-01T21:52:28Z","updated_at":"2018-04-01T21:52:28Z","author_association":"NONE","body":"This issue is spotted again with recent Yarn v1.5.1 on macOS 10.12.6 (16G1212)\r\nI've lost quite a big chunk of new source code due to it.\r\n\r\nSteps:\r\nyarn init -y\r\nyarn add moment\r\nmkdir src\r\ntouch src/file.js\r\nln -s ../src node_modules/@link\r\nls src\r\nyarn add ramda\r\nls src\r\n\r\nObserve:\r\nempty src dir"}}
{"actor":{"display_login":"zubko"}}