-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
npm causes the windows installer (.msi) to almost reach MAX_PATH (and using the .zip can easily exceed it) #19449
Comments
Same issue was reported in #17409. Upstream issue was opened here npm/npm#19317, but there was no action taken. I think we should do something about this, I'm +1 on dedup, but I'm not an npm expert. /cc @zkat |
@bzoz I've tried running
|
For npm to flatten its dependencies, Node.js will need to fix a long standing bug in its installer where the new version of Node + npm is just extracted over the existing version. If we flattened deps in the new version, the deeply nested versions would still be on disk from the previous install and Node's module resolution algorithm would resolving those instead, causing confusing errors. We first realized this was going on with the first release of npm@3, at which time we had to stop flattening. |
If folks with this issue could try updating to 10.3.4, I think you'll find that it is resolved now (the installer related limitations on flattening were, in turns out, fixed last ~February, so the most recent version of npm is now maximally flat). |
@iarna I couldn't find a release for 10.3.4 but I did install 10.4.0 (the latest) and it is much better 😄. I think we can close this.
|
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.0
installer: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).The text was updated successfully, but these errors were encountered: