microsoft / nodejs-guidelines

Tips, tricks, and resources for working with Node.js, and the start of an ongoing conversation on how we can improve the Node.js experience on Microsoft platforms.
2.49k stars 280 forks source link

Update `MAX_PATH` guidance for `LongPathsEnabled`? #108

Open karlhorky opened 10 months ago

karlhorky commented 10 months ago

The MAX_PATH explanation and workarounds guide by @mousetraps seems like a nice set of workarounds and explanation, but seems outdated now (eg. mentions npm v3, doesn't mention LongPathsEnabled)

If LongPathsEnabled is enabled on Windows, is there guidance for getting long paths supported in Node.js as well? Or is there a bug tracking this 260+ characters long paths support in Node.js?

Context:

  1. I am not sure if I'm understanding the details of internal Node.js support of long paths yet, but I do see this comment by @bzoz that "Node uses file namespace paths for file access. We do that so we do not get hit by the 260 path limit," - maybe this only applies to writeFile?
  2. The reason I started all of this is that I'm currently coming from this ESLint bug, which occurs when ESLint tries to import long node_modules paths https://github.com/eslint/eslint/issues/17763

It would be great to get support for long file paths on Windows in Node.js!

karlhorky commented 10 months ago

I also opened an issue in Node.js to see whether the 260 character limit is expected:

karlhorky commented 2 days ago

Node.js 22.7.0 no longer has long paths problems on Windows, when LongPathsEnabled is set: