{"action":"created","issue":{"url":"https://api.github.com/repos/lerna/lerna/issues/677","repository_url":"https://api.github.com/repos/lerna/lerna","labels_url":"https://api.github.com/repos/lerna/lerna/issues/677/labels{/name}","comments_url":"https://api.github.com/repos/lerna/lerna/issues/677/comments","events_url":"https://api.github.com/repos/lerna/lerna/issues/677/events","html_url":"https://github.com/lerna/lerna/issues/677","id":214504572,"number":677,"title":"transitive dependencies of non-hoisted dependencies replace hoisted versions","user":{"login":"jppurcell9","id":1966782,"avatar_url":"https://avatars0.githubusercontent.com/u/1966782?v=3","gravatar_id":"","url":"https://api.github.com/users/jppurcell9","html_url":"https://github.com/jppurcell9","followers_url":"https://api.github.com/users/jppurcell9/followers","following_url":"https://api.github.com/users/jppurcell9/following{/other_user}","gists_url":"https://api.github.com/users/jppurcell9/gists{/gist_id}","starred_url":"https://api.github.com/users/jppurcell9/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jppurcell9/subscriptions","organizations_url":"https://api.github.com/users/jppurcell9/orgs","repos_url":"https://api.github.com/users/jppurcell9/repos","events_url":"https://api.github.com/users/jppurcell9/events{/privacy}","received_events_url":"https://api.github.com/users/jppurcell9/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2017-03-15T19:44:54Z","updated_at":"2017-03-16T15:19:28Z","closed_at":null,"body":"Say I have a package that depends on `lodash@4` and another module `uses-old-lodash` with a transitive dependency on `lodash@3`.  If I do a regular `lerna bootstrap`, I end up with the following in my `node_modules` folder:\r\n\r\n```\r\n.\r\n└── my-package\r\n    └── node-modules\r\n        ├── lodash@4\r\n        └── uses-old-lodash\r\n            └── node-modules\r\n                └── lodash@3\r\n```\r\n\r\nNormally, using `lerna bootstrap --hoist` will pull the dependencies up to the top level without a problem.  But, if for some reason we can't hoist `uses-old-lodash` (either because of a version conflict or `--nohoist=uses-old-lodash`), then we end up with the following structure:\r\n\r\n```\r\n.\r\n├── node_modules\r\n│   └── lodash@4\r\n└── my-package\r\n    └── node-modules\r\n        ├── lodash@3\r\n        └── uses-old-lodash\r\n```\r\n\r\nBecause of the way npm is flattening dependencies (npm@3 and above), `lodash@3` comes up to the root of `my-package/node-modules` when `lodash@4` gets hoisted.  So if I `require('lodash')` in a script in `my-package`, I'm going to get the wrong version of `lodash`.\r\n\r\nIt would be nice if the transitive dependencies did not get flattened in the case where a different version of the same dependency has been hoisted."},"comment":{"url":"https://api.github.com/repos/lerna/lerna/issues/comments/287090811","html_url":"https://github.com/lerna/lerna/issues/677#issuecomment-287090811","issue_url":"https://api.github.com/repos/lerna/lerna/issues/677","id":287090811,"user":{"login":"spudly","id":487068,"avatar_url":"https://avatars3.githubusercontent.com/u/487068?v=3","gravatar_id":"","url":"https://api.github.com/users/spudly","html_url":"https://github.com/spudly","followers_url":"https://api.github.com/users/spudly/followers","following_url":"https://api.github.com/users/spudly/following{/other_user}","gists_url":"https://api.github.com/users/spudly/gists{/gist_id}","starred_url":"https://api.github.com/users/spudly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spudly/subscriptions","organizations_url":"https://api.github.com/users/spudly/orgs","repos_url":"https://api.github.com/users/spudly/repos","events_url":"https://api.github.com/users/spudly/events{/privacy}","received_events_url":"https://api.github.com/users/spudly/received_events","type":"User","site_admin":false},"created_at":"2017-03-16T15:19:28Z","updated_at":"2017-03-16T15:19:28Z","body":"I'm having a similar problem in my builds where it is installing the wrong version of 'uuid' intermittently (about 50% of the time) on the build server.\r\n\r\nI haven't nailed down the exact problem, but I think it may be related to the same de-duping behavior of npm."}}
{"actor":{"display_login":"spudly"}}