{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/10095","labels_url":"https://api.github.com/repos/npm/npm/issues/10095/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/10095/comments","events_url":"https://api.github.com/repos/npm/npm/issues/10095/events","html_url":"https://github.com/npm/npm/issues/10095","id":113049565,"number":10095,"title":"Npm installs binaries of flattened dependencies into node_modules/.bin","user":{"login":"sheerun","id":292365,"avatar_url":"https://avatars.githubusercontent.com/u/292365?v=3","gravatar_id":"","url":"https://api.github.com/users/sheerun","html_url":"https://github.com/sheerun","followers_url":"https://api.github.com/users/sheerun/followers","following_url":"https://api.github.com/users/sheerun/following{/other_user}","gists_url":"https://api.github.com/users/sheerun/gists{/gist_id}","starred_url":"https://api.github.com/users/sheerun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheerun/subscriptions","organizations_url":"https://api.github.com/users/sheerun/orgs","repos_url":"https://api.github.com/users/sheerun/repos","events_url":"https://api.github.com/users/sheerun/events{/privacy}","received_events_url":"https://api.github.com/users/sheerun/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-10-23T16:01:30Z","updated_at":"2015-10-23T16:49:49Z","closed_at":"2015-10-23T16:25:27Z","body":"Hey,\r\n\r\nI've noticed that when installing `electron-rebuild` with npm@3, then `npm` binary is added to `node_modules/.bin`.\r\n\r\nHow to reproduce:\r\n\r\n```\r\nexport PATH=./node_modules/.bin:$PATH\r\nnpm --version # 3.3.10\r\nnpm init\r\nnpm install --save electron-rebuild\r\nnpm --version # 2.14.8\r\n```\r\n\r\nI'd expect that `npm` binary is only installed into `electron-rebuild/node_modules/.bin` (and that's the behavior of npm 2.x). I don't want to pollute my binaries by dependencies of my dependencies. The only binary I want when installing `electron-rebuild` is `electron-rebuild`.\r\n\r\nAny comments? :)"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/150630829","html_url":"https://github.com/npm/npm/issues/10095#issuecomment-150630829","issue_url":"https://api.github.com/repos/npm/npm/issues/10095","id":150630829,"user":{"login":"sheerun","id":292365,"avatar_url":"https://avatars.githubusercontent.com/u/292365?v=3","gravatar_id":"","url":"https://api.github.com/users/sheerun","html_url":"https://github.com/sheerun","followers_url":"https://api.github.com/users/sheerun/followers","following_url":"https://api.github.com/users/sheerun/following{/other_user}","gists_url":"https://api.github.com/users/sheerun/gists{/gist_id}","starred_url":"https://api.github.com/users/sheerun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sheerun/subscriptions","organizations_url":"https://api.github.com/users/sheerun/orgs","repos_url":"https://api.github.com/users/sheerun/repos","events_url":"https://api.github.com/users/sheerun/events{/privacy}","received_events_url":"https://api.github.com/users/sheerun/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T16:49:49Z","updated_at":"2015-10-23T16:49:49Z","body":"> This is the intended behavior, and is necessary so that package scripts (which use those links) will continue to work with maximally flat install tree in npm@3.\r\n\r\nHow are they supposed to work? How `electron-rebuild` knows it needs to look into `../.bin/npm` instead of `./node_modules/.bin/npm`? I think no scripts are using it dependencies this way. For example `electron-rebuild` is using npm binaries by resolving with `require.resolve('npm/node_modules/node-gyp/bin/node-gyp')`, and that works without symlinking unnecessary binaries to `.bin`."}}