{"action":"created","issue":{"url":"https://api.github.com/repos/npm/npm/issues/20101","repository_url":"https://api.github.com/repos/npm/npm","labels_url":"https://api.github.com/repos/npm/npm/issues/20101/labels{/name}","comments_url":"https://api.github.com/repos/npm/npm/issues/20101/comments","events_url":"https://api.github.com/repos/npm/npm/issues/20101/events","html_url":"https://github.com/npm/npm/issues/20101","id":306540372,"node_id":"MDU6SXNzdWUzMDY1NDAzNzI=","number":20101,"title":"Installing npm almost reaches MAX_PATH on Windows","user":{"login":"TheCloudlessSky","id":613788,"node_id":"MDQ6VXNlcjYxMzc4OA==","avatar_url":"https://avatars2.githubusercontent.com/u/613788?v=4","gravatar_id":"","url":"https://api.github.com/users/TheCloudlessSky","html_url":"https://github.com/TheCloudlessSky","followers_url":"https://api.github.com/users/TheCloudlessSky/followers","following_url":"https://api.github.com/users/TheCloudlessSky/following{/other_user}","gists_url":"https://api.github.com/users/TheCloudlessSky/gists{/gist_id}","starred_url":"https://api.github.com/users/TheCloudlessSky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheCloudlessSky/subscriptions","organizations_url":"https://api.github.com/users/TheCloudlessSky/orgs","repos_url":"https://api.github.com/users/TheCloudlessSky/repos","events_url":"https://api.github.com/users/TheCloudlessSky/events{/privacy}","received_events_url":"https://api.github.com/users/TheCloudlessSky/received_events","type":"User","site_admin":false},"labels":[{"id":172076,"node_id":"MDU6TGFiZWwxNzIwNzY=","url":"https://api.github.com/repos/npm/npm/labels/windows","name":"windows","color":"00177D","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-19T16:39:14Z","updated_at":"2018-06-19T20:30:24Z","closed_at":null,"author_association":"NONE","body":"#### I'm opening this issue because:\r\n\r\n  - [ ] npm is crashing.\r\n  - [ ] npm is producing an incorrect install.\r\n  - [ ] npm is doing something I don't understand.\r\n  - [x] Other (_see below for feature requests_):\r\n\r\n#### What's going wrong?\r\n\r\nSee nodejs/node#19449. Using the Node Windows Installer (.msi), the Windows Binary (.zip), or directly downloading from [the GitHub releases](https://github.com/npm/npm/releases) the installation *almost* reaches the [MAX_PATH allowed in Windows](https://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath) (260 characters) or very easily exceed it when using the .zips. For example, here's the top 10 paths by length from the `8.10.0` installer:\r\n\r\n```\r\n$ cmd /c dir /S /B | Sort-Object { -$_.Length; } | Select-Object -First 10 | % { \"$($_.Length) = $_\" }\r\n239 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\libnpx\\node_modules\\yargs\\node_modules\\read-pkg-up\\node_modules\\read-pkg\\node_modules\\load-json-file\\node_modules\\parse-json\\node_modules\\error-ex\\node_modules\\is-arrayish\\.istanbul.yml\r\n239 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\libnpx\\node_modules\\yargs\\node_modules\\read-pkg-up\\node_modules\\read-pkg\\node_modules\\load-json-file\\node_modules\\parse-json\\node_modules\\error-ex\\node_modules\\is-arrayish\\.editorconfig\r\n238 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-profile\\node_modules\\make-fetch-happen\\node_modules\\https-proxy-agent\\node_modules\\agent-base\\node_modules\\es6-promisify\\node_modules\\es6-promise\\lib\\es6-promise\\promise\\resolve.js\r\n238 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-profile\\node_modules\\make-fetch-happen\\node_modules\\socks-proxy-agent\\node_modules\\agent-base\\node_modules\\es6-promisify\\node_modules\\es6-promise\\lib\\es6-promise\\promise\\resolve.js\r\n238 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\libnpx\\node_modules\\yargs\\node_modules\\read-pkg-up\\node_modules\\read-pkg\\node_modules\\load-json-file\\node_modules\\parse-json\\node_modules\\error-ex\\node_modules\\is-arrayish\\package.json\r\n237 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-profile\\node_modules\\make-fetch-happen\\node_modules\\socks-proxy-agent\\node_modules\\agent-base\\node_modules\\es6-promisify\\node_modules\\es6-promise\\lib\\es6-promise\\promise\\reject.js\r\n237 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\libnpx\\node_modules\\yargs\\node_modules\\read-pkg-up\\node_modules\\read-pkg\\node_modules\\load-json-file\\node_modules\\parse-json\\node_modules\\error-ex\\node_modules\\is-arrayish\\.travis.yml\r\n237 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-profile\\node_modules\\make-fetch-happen\\node_modules\\https-proxy-agent\\node_modules\\agent-base\\node_modules\\es6-promisify\\node_modules\\es6-promise\\lib\\es6-promise\\promise\\reject.js\r\n237 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\npm-profile\\node_modules\\make-fetch-happen\\node_modules\\http-proxy-agent\\node_modules\\agent-base\\node_modules\\es6-promisify\\node_modules\\es6-promise\\lib\\es6-promise\\promise\\resolve.js\r\n236 = C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\libnpx\\node_modules\\yargs\\node_modules\\read-pkg-up\\node_modules\\read-pkg\\node_modules\\load-json-file\\node_modules\\parse-json\\node_modules\\error-ex\\node_modules\\is-arrayish\\.npmignore\r\n```\r\n\r\nThe .msi installer is very close to failing to install to `C:\\Program Files\\nodejs` if any module that npm depends on grows to a longer path. This isn't a problem when *using* npm since it'll properly dedupe the packages with npm > 3. This problem is with the installation of npm itself (which Node includes with its releases). Ideally, `node_modules/npm` would be pre-deduped so that it's not so long.\r\n\r\nFor now, I've had to switch to the `yarn` package manager. It's just a single file, not a deep directory structure to install. \r\n\r\n#### How can the CLI team reproduce the problem?\r\n\r\nInstall the .msi or .zip for Node 5.6.0 (current) or 8.10.0 (LTS). Or, download the .zip directly from [the GitHub releases](https://github.com/npm/npm/releases). \r\n\r\n### supporting information:\r\n\r\n - `npm -v` prints: 5.6.0\r\n - `node -v` prints: 8.10.0\r\n - `npm config get registry` prints: https://registry.npmjs.org/\r\n - Windows, OS X/macOS, or Linux?: Windows 7 64-bit"},"comment":{"url":"https://api.github.com/repos/npm/npm/issues/comments/398534924","html_url":"https://github.com/npm/npm/issues/20101#issuecomment-398534924","issue_url":"https://api.github.com/repos/npm/npm/issues/20101","id":398534924,"node_id":"MDEyOklzc3VlQ29tbWVudDM5ODUzNDkyNA==","user":{"login":"mhoeger","id":8888531,"node_id":"MDQ6VXNlcjg4ODg1MzE=","avatar_url":"https://avatars2.githubusercontent.com/u/8888531?v=4","gravatar_id":"","url":"https://api.github.com/users/mhoeger","html_url":"https://github.com/mhoeger","followers_url":"https://api.github.com/users/mhoeger/followers","following_url":"https://api.github.com/users/mhoeger/following{/other_user}","gists_url":"https://api.github.com/users/mhoeger/gists{/gist_id}","starred_url":"https://api.github.com/users/mhoeger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhoeger/subscriptions","organizations_url":"https://api.github.com/users/mhoeger/orgs","repos_url":"https://api.github.com/users/mhoeger/repos","events_url":"https://api.github.com/users/mhoeger/events{/privacy}","received_events_url":"https://api.github.com/users/mhoeger/received_events","type":"User","site_admin":false},"created_at":"2018-06-19T20:30:24Z","updated_at":"2018-06-19T20:30:24Z","author_association":"NONE","body":"Is this issue still not addressed?"}}
{"actor":{"display_login":"mhoeger"}}