- Version: current release (9.8.0) and LTS (8.10.0)
- Platform: Windows 7 64-bit
After installing Node 9.8.0 or 8.10.0 via the Windows Installer (.msi), the installation almost reaches the MAX_PATH allowed in Windows (260 characters). Here's the top 10 paths by length from the 8.10.0 installer:
$ cmd /c dir /S /B | Sort-Object { -$_.Length; } | Select-Object -First 10 | % { "$($_.Length) = $_" }
239 = 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
239 = 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
238 = 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
238 = 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
238 = 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
237 = 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
237 = 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
237 = 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
237 = 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
236 = 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
I also use the .zip which can easily run into this problem if it isn't unzipped to a short enough path.
The .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.
I plan to report this issue to the NPM team as well. For now, I've switched to using the standalone .exe and the yarn package manager (since it's just a single file and not a huge directory structure).
After installing Node 9.8.0 or 8.10.0 via the
Windows Installer (.msi), the installation almost reaches the MAX_PATH allowed in Windows (260 characters). Here's the top 10 paths by length from the8.10.0installer:I also use the .zip which can easily run into this problem if it isn't unzipped to a short enough path.
The .msi installer is very close to failing to install to
C:\Program Files\nodejsif 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/npmwould be pre-deduped so that it's not so long.I plan to report this issue to the NPM team as well. For now, I've switched to using the standalone .exe and the
yarnpackage manager (since it's just a single file and not a huge directory structure).