{"action":"opened","issue":{"url":"https://api.github.com/repos/npm/npm/issues/11386","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/11386/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/11386/comments","events_url":"https://api.github.com/repos/npm/npm/issues/11386/events","html_url":"https://github.com/npm/npm/issues/11386","id":130845239,"number":11386,"title":"`npm install` succeeds (with a false-positive), while `npm ls` throws \"UNMET DEPENDENCY\" if a submodule depends on a different version of itself","user":{"login":"lxe","id":1486609,"avatar_url":"https://avatars.githubusercontent.com/u/1486609?v=3","gravatar_id":"","url":"https://api.github.com/users/lxe","html_url":"https://github.com/lxe","followers_url":"https://api.github.com/users/lxe/followers","following_url":"https://api.github.com/users/lxe/following{/other_user}","gists_url":"https://api.github.com/users/lxe/gists{/gist_id}","starred_url":"https://api.github.com/users/lxe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lxe/subscriptions","organizations_url":"https://api.github.com/users/lxe/orgs","repos_url":"https://api.github.com/users/lxe/repos","events_url":"https://api.github.com/users/lxe/events{/privacy}","received_events_url":"https://api.github.com/users/lxe/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-02-02T22:50:34Z","updated_at":"2016-02-02T22:50:34Z","closed_at":null,"body":"Consider we have the following package versions:\r\n\r\n1.0.0 package.json:\r\n```\r\n{\r\n  \"name\": \"self-dep\",\r\n  \"version\": \"1.0.0\"\r\n}\r\n```\r\n\r\n2.0.0 package.json:\r\n```\r\n{\r\n  \"name\": \"self-dep\",\r\n  \"version\": \"2.0.0\",\r\n  \"dependencies\": {\r\n    \"self-dep\": \"1.0.0\"\r\n  }\r\n}\r\n```\r\n\r\n3.0.0 package.json:\r\n```\r\n{\r\n  \"name\": \"self-dep\",\r\n  \"version\": \"3.0.0\",\r\n  \"dependencies\": {\r\n    \"self-dep\": \"2.0.0\"\r\n  }\r\n}\r\n```\r\n\r\n*NOTE: I actually published these packages to npm to demonstrate*\r\n\r\nRunning `npm install` on 3.0.0 **succeeds** and yields the following tree:\r\n\r\n```\r\nnode_modules\r\n└── self-dep\r\n    └── package.json\r\n```\r\n\r\nWhere only one layer of self-dep is installed, which is self-dep@2.0.0\r\n\r\nRunning `npm ls` will then produce the following error:\r\n\r\n```\r\nself-dep@3.0.0 /Users/lxe/devel/self-dep\r\n└─┬ self-dep@2.0.0\r\n  └── UNMET DEPENDENCY self-dep@1.0.0\r\n```\r\n\r\nIn this case, npm3 should produce a deep tree instead of attempting to flatten it. This works fine with npm 2.14.17:\r\n\r\n```\r\nnode_modules\r\n└── self-dep\r\n    ├── node_modules\r\n    │   └── self-dep\r\n    │       └── package.json\r\n    └── package.json\r\n```\r\n\r\n\r\n\r\n"}}