{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/6912","labels_url":"https://api.github.com/repos/npm/npm/issues/6912/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/6912/comments","events_url":"https://api.github.com/repos/npm/npm/issues/6912/events","html_url":"https://github.com/npm/npm/issues/6912","id":51796363,"number":6912,"title":"`npm install` should deduplicate its tree as part of the install process","user":{"login":"iarna","id":983798,"avatar_url":"https://avatars.githubusercontent.com/u/983798?v=3","gravatar_id":"","url":"https://api.github.com/users/iarna","html_url":"https://github.com/iarna","followers_url":"https://api.github.com/users/iarna/followers","following_url":"https://api.github.com/users/iarna/following{/other_user}","gists_url":"https://api.github.com/users/iarna/gists{/gist_id}","starred_url":"https://api.github.com/users/iarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iarna/subscriptions","organizations_url":"https://api.github.com/users/iarna/orgs","repos_url":"https://api.github.com/users/iarna/repos","events_url":"https://api.github.com/users/iarna/events{/privacy}","received_events_url":"https://api.github.com/users/iarna/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/npm/npm/labels/feature-request","name":"feature-request","color":"ACE1AF"},{"url":"https://api.github.com/repos/npm/npm/labels/next-major","name":"next-major","color":"FFFF00"},{"url":"https://api.github.com/repos/npm/npm/labels/windows","name":"windows","color":"0b02e1"}],"state":"closed","locked":false,"assignee":{"login":"iarna","id":983798,"avatar_url":"https://avatars.githubusercontent.com/u/983798?v=3","gravatar_id":"","url":"https://api.github.com/users/iarna","html_url":"https://github.com/iarna","followers_url":"https://api.github.com/users/iarna/followers","following_url":"https://api.github.com/users/iarna/following{/other_user}","gists_url":"https://api.github.com/users/iarna/gists{/gist_id}","starred_url":"https://api.github.com/users/iarna/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iarna/subscriptions","organizations_url":"https://api.github.com/users/iarna/orgs","repos_url":"https://api.github.com/users/iarna/repos","events_url":"https://api.github.com/users/iarna/events{/privacy}","received_events_url":"https://api.github.com/users/iarna/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/npm/npm/milestones/4","html_url":"https://github.com/npm/npm/milestones/multi-stage%20install","labels_url":"https://api.github.com/repos/npm/npm/milestones/4/labels","id":730261,"number":4,"title":"multi-stage install","description":null,"creator":{"login":"othiym23","id":418097,"avatar_url":"https://avatars.githubusercontent.com/u/418097?v=3","gravatar_id":"","url":"https://api.github.com/users/othiym23","html_url":"https://github.com/othiym23","followers_url":"https://api.github.com/users/othiym23/followers","following_url":"https://api.github.com/users/othiym23/following{/other_user}","gists_url":"https://api.github.com/users/othiym23/gists{/gist_id}","starred_url":"https://api.github.com/users/othiym23/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/othiym23/subscriptions","organizations_url":"https://api.github.com/users/othiym23/orgs","repos_url":"https://api.github.com/users/othiym23/repos","events_url":"https://api.github.com/users/othiym23/events{/privacy}","received_events_url":"https://api.github.com/users/othiym23/received_events","type":"User","site_admin":false},"open_issues":5,"closed_issues":74,"state":"open","created_at":"2014-07-23T22:21:24Z","updated_at":"2015-04-30T05:55:57Z","due_on":null,"closed_at":null},"comments":34,"created_at":"2014-12-12T11:28:29Z","updated_at":"2015-04-30T12:51:31Z","closed_at":"2015-03-27T21:13:31Z","body":"This is intended to solve a few larger project goals:\r\n\r\n1. Installs should be smaller, without having to explicitly ask for it.\r\n2. For Windows user's sake, we should do our best to avoid long path names. Many windows tools are limited to 256 characters.\r\n\r\nAs such, @othiym23 and I have decided this should be a maximally flat deduplication, which means if you have a dep tree of:\r\n\r\n    A → B → C\r\n\r\nThen if you install A, you'll get B and C next to it in your node modules. That is, it'll be installed as:\r\n\r\n    A\r\n    B\r\n    C\r\n\r\nBut we'll hold onto metadata to know why B and C were installed such that removing A will remove B and C as it would now.\r\n\r\nAs for devDependencies, they shouldn't have their dependencies folded in as above. Instead each of them should essentially act as its own root. So if A above were a dev dependency then it would be installed as:\r\n\r\n    A → B\r\n        C\r\n\r\nThe following work remains to be done:\r\n\r\n* [x] The core deduplicated install work needs to be completed. It is currently in progress.\r\n* #7273 `npm outdated` needs to structure its output in a way that makes sense with a flat node_modules folder. \r\n* #7272 `npm ls` needs to structure its output in a way that makes sense with a flat node_modules folder. \r\n\r\nSee also: #4761, #4037, #5465"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/97762842","html_url":"https://github.com/npm/npm/issues/6912#issuecomment-97762842","issue_url":"https://api.github.com/repos/npm/npm/issues/6912","id":97762842,"user":{"login":"FractalizeR","id":318489,"avatar_url":"https://avatars.githubusercontent.com/u/318489?v=3","gravatar_id":"","url":"https://api.github.com/users/FractalizeR","html_url":"https://github.com/FractalizeR","followers_url":"https://api.github.com/users/FractalizeR/followers","following_url":"https://api.github.com/users/FractalizeR/following{/other_user}","gists_url":"https://api.github.com/users/FractalizeR/gists{/gist_id}","starred_url":"https://api.github.com/users/FractalizeR/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/FractalizeR/subscriptions","organizations_url":"https://api.github.com/users/FractalizeR/orgs","repos_url":"https://api.github.com/users/FractalizeR/repos","events_url":"https://api.github.com/users/FractalizeR/events{/privacy}","received_events_url":"https://api.github.com/users/FractalizeR/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T12:51:31Z","updated_at":"2015-04-30T12:51:31Z","body":">I have a `lodash.isarray` dependency, install a lot of gulp packages, remove `lodash.isarray` dependency...\r\n\r\nWell, I guess we should not allow a required dependency to be uninstalled without the use of something like `--force` key. This is a part of dependency management."}}