{"action":"opened","issue":{"url":"https://api.github.com/repos/primus/primus/issues/334","labels_url":"https://api.github.com/repos/primus/primus/issues/334/labels{/name}","comments_url":"https://api.github.com/repos/primus/primus/issues/334/comments","events_url":"https://api.github.com/repos/primus/primus/issues/334/events","html_url":"https://github.com/primus/primus/issues/334","id":53875305,"number":334,"title":"Primus.require fails with new npm install algorithm","user":{"login":"Dignifiedquire","id":790842,"avatar_url":"https://avatars.githubusercontent.com/u/790842?v=3","gravatar_id":"","url":"https://api.github.com/users/Dignifiedquire","html_url":"https://github.com/Dignifiedquire","followers_url":"https://api.github.com/users/Dignifiedquire/followers","following_url":"https://api.github.com/users/Dignifiedquire/following{/other_user}","gists_url":"https://api.github.com/users/Dignifiedquire/gists{/gist_id}","starred_url":"https://api.github.com/users/Dignifiedquire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Dignifiedquire/subscriptions","organizations_url":"https://api.github.com/users/Dignifiedquire/orgs","repos_url":"https://api.github.com/users/Dignifiedquire/repos","events_url":"https://api.github.com/users/Dignifiedquire/events{/privacy}","received_events_url":"https://api.github.com/users/Dignifiedquire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-01-09T14:53:13Z","updated_at":"2015-01-09T14:53:13Z","closed_at":null,"body":"When trying to use the `sockjs-client` inside a nested dependency on node.js `primus.require` fails, because the new `npm install` does some deduplication work, resulting in only one primus install at the top level (as the top level module requires primus as well). \r\n\r\nI'm not entirely sure if this is a bug of npm or primus, but I think it needs some thought and fixing from some side.\r\n\r\nIn the repository below you can find a reproduction, trying to use `primus.require` results in an undefined result, as it can not find the nested `sockjs-client-node` module from the top level `primus` installation. \r\n\r\nnpm version: `2.1.18`\r\n\r\n**Full Structure**\r\n\r\n```\r\n|-- node_modules\r\n|  |-- primus\r\n|  `-- dep1\r\n|     `-- node_modules\r\n|        |-- primus\r\n|        `-- sockjs-client-node\r\n|\r\n|-- index.js\r\n```\r\n\r\n**Deduped Structure**\r\n\r\n```\r\n|-- node_modules\r\n|  |-- primus\r\n|  |-- dep1\r\n|     |-- node_modules\r\n|        `-- sockjs-client-node\r\n|\r\n|-- index.js\r\n```\r\n\r\n\r\n**Repro Repository**\r\nhttps://github.com/Dignifiedquire/npm-primus-bug"}}