zkat / cacache

💩💵 but for your data. If you've got the hash, we've got the cache ™ (moved)

Home Page:https://github.com/npm/cacache

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Windows git clean path too long

philjones88 opened this issue · comments

Arrived here trying to track down the cause of a suddenly recent windows + node issue.

We're using uglifyjs-webpack-plugin (that the author says uses this package see webpack-contrib/uglifyjs-webpack-plugin#236 (comment)).

We've recently started to see these failures on our windows + node (v8.9.x) agents:

12:34:13 stderr: warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/05/22/4869c2ba376b291886d5971e8dfcffb9b916ce22b2c1e8d5ae3353fa442baad94caa312b0ae927becb4efb338e92e0ea1d9e452642473e880daf74d0f874': Filename too long

12:34:13 warning: Could not stat path 'src/VQ/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/07/21/291aa27170fc20daff713f1b57ff8711a6d3bd1bbbae7d3b27fbe52ec4ecf1bd51e1ce1c83e88f3a1102c5ab667d2dcd5d8c6e6fccf01804637ec693efeb': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/08/a6/bbb979e988cc094831cbd010906d357bea4daa4de7b57ea561c78fc268edbe5a8b325696054e8d98996359908ce0033c410d04b239735dfd6eb2d9716f49': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/13/15/f0dc7edfea3aa1e0e4feef330bc7447d1bf4ec7a3b934a332a82a2b476399d89089abdd2014d9e2172cd1711c9fe6b4562c0da56c949417d73dab05c1ea0': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/1a/7a/cb048cfade32a1c37b1f1deff0d2bcc967204ba853a24c4365d7231a5584a67c0456457426b76944369778333688c96d52344570bb23e0c0667fbf18c598': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/1d/df/aa2f2d49744220d83fd0c5a09151a9e161b6767801c50aecf76142f516b5c01da9033be6a62fa6d1666e4649df11bbe0a520ef4a3413c9c81f202a159fa4': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/24/18/11a893565fae14e8e80c7ba691f8e03b42643ba4d3ab9c380f2fd2115f038ad4896220d342f7030b1808f673de55a345d1ab5b451737dc0ee90526f666a7': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/29/b7/3cf379fcb77c7079851e0fe4497d461b7b19ea5b655eae3cd17f081953ef703e27d9df4953f86dd3df30c2c69e840f7b23c6534774ce618e99081451f74c': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/2c/c2/d5372f14c58431b6984baf2dfb48f3576abd2b4d1bfcff671d0b1046e0c301fa130573b259718d2f27d5ce535892b00f4303d0fb553ee1fde631644edc80': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/2d/51/65d803407152f4c9a9864e6b8d8f2e9c0222e1eb1635e84de913c2dc28b055cf9f8a0dcbdd0e33ab4062f60acd5cff1dbdcbe29f2d3aad3f35a7c304df29': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/30/05/fdea100ce27f240633eb2b59589d861c9360be42c6edec90922ac6b1e496a81f0953a09701b5e655e012a94bf94639dd972b7a03a8ffdd5f28f5c0bbebdb': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/38/75/4deddf698b636fbc4014268af093531b2a422dab8191cf810612e44cefe982c4ce7becb3b4f9a1e1367f338bfc5b70cd0b60f010560c5800ce4190e0260f': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/58/18/14dc7f55cccbefd69dc6c2e6a42582462a09262cd57da728653ff80e69b1ff247c6cbe8489d16cde07a51590242e4a2c923c3b11f33b5484a1f85ed870a0': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/68/10/41f51dd051ab21dc286177dab8534b1bbd7cdcdd4f0af1216dbeb05f038fab6abd18c8d6ad82a66a1621b0a9c1e3f5a08ec8f4e5f0c95d4f62dadab84713': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/70/8c/ca1f95d2f5a96d74a47563537549eae82b8bfc881cb7f3d93d29634c3e11cdb134fb212a9e18bdadb381539f8618f731bbbd0bed6a987dad8d31198126ec': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/77/15/7d90ab36d727acf8dc8bc3d42987e2cbae3bba8c6845d496a72ab01322284cfede30848f8fa2ff1a160fd04041bcc4970db9aa41d0f7946556af7d481353': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/7e/f3/dae2737a46b9e68ef64bffe52dcb2582534b88838f0536f3ccac7cf91b255ec00cc77d728a92afd6958fc72c63ff0dfe4d383f1ebcdb34099b85e6fb6678': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/81/2d/7901b174b76efbd97a1bf1bae3224a93c6658ae35d4a39050462f4de46add6bae1a371cfa82ca75d22f6bd3a6c8f9f62c2010bc35b61cf382e3c2f93a53f': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/82/4e/eb77a7258fc004486de10f96a55cb63044fda88af84a309656924b746b783939bb0a0aac27ab814faa0350d2e84861bcd1e49cc97a0466b8869cb2c2d5e0': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/85/66/7635fe3574673816c1593b8ec028d52572361ae7bd6fc327c71280286645478b401b8a2d6a423da6deac9030c87ee49378d18d19486d59be3f80dd67e0b0': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/8a/51/4680d4da4a9ee83e0b527b5fefe7b076f4b75f913a5704b45a9c239ba748840ecad4064d609270935ffe0875beab65af71f258e3396b7eab51d5e2be0882': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/8e/db/c7903b46a97fec1214add5c9b67e4a295fe7df4c73d77587f142a833bbebe2451e950b4263e7092086a2a277ebf0078e25fdba0af20e4973361a38505568': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/a3/1b/cca7afec56653538fbf19940b3c538f33ce9e12400258d45df0739b5b9bc35a27ad9d14883f6f9cf5b34753740020096632577819a66a383154d0bd91230': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/a6/99/de2bcbe365464265c55b19d5fe370516ff88184683e6a0f703babed194b6f16aec7e7e665f14eecbf757cec3282f27dbdd486d00243942618769d55d1297': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/ae/e3/89dab0d6629ce6edc463d2bb4e78782ed62f93b86405bdab35e9d84662c1deca874ca557ec827d583f2e25f0a44a488d9e7fcb2ead268d3c28c202da49ca': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/b6/1e/8ce11981b0e98da8ddee46bc82f0f74b7bc85292e273f17c791d71b035d767318c8d3e0f0fa303faf442327386bb17153388556cbdeb8a79e06a7bd9f8ac': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/be/d4/858abcc83ad2e836a37661402465e8cfffaa443581e26715c423e5a0cae1cd0d0d463c8d5a20bec19b26c4e89bdba1fbe9f05d148211b363256ba9d10b80': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/bf/ba/d6632f295211c501cab8ce9ea7ee77f7ee9ea1d57c1300098d95d74b06aa33d8881265d644aeb19db65d4df90e6467902bb3133cdee18cf8428bdaed42db': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/c6/fa/0973a73ff12b9bb38877204c6ead1d66b42290b37483e670965ae373e7522daeb38d08ead87c28231015277c4b791f95f5c0fb2f2340ba4834820d927fd4': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/cc/48/7629ad7212f220d6573627ae2e9f8d80a651050c93243087eff325688e6780229424a09b5d997e770fb315a3d54dfbb0282bd57fcadd301000e7c4c04bac': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/cc/fb/368f0aa760df7abe06901b830664523ac05e5bcd8bdc06880de745d7bc37acd770fced7cf0b7a6c118ea169f293e2f08c7f78986dc578cf65d57169b5e76': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/da/a3/bc6f66f19e263eb92d7ae62c1a193ba6909ed46f36dd868e895570a37bf33e15721b793b49332747a987c0c6b13fd68346c255ea2276eedac7452afd9cc9': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/de/7a/9303e5de054b060898c82c77785e358f4a3e22e7ece9e38403215a15b6cdc2314c7672e882b900c6277eb63fea2f597a8494158adcfcbf2567753804c1da': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/e6/0c/758f10683e16419b0bb737212df2ac31c751afb857b6d1e0d470aeef49bc99f1b6562abb00471da46faa96c477d17ad1d61eaa1c0f5c10f82c5230692c7c': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/e9/51/c2429a802c5dab3763fcfd7cbe4f6a683090b545008a3cdafd4410b6ddf9a83d2eaff493ced4c8a29847cfdaca1bfa020749d973f93f8ffbb9dfeca74c19': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/ee/76/7c9506752196af462837441ed9285299a495391bb557adfbf9424c6257dba0b013ae7d370a5f53ad17c07134d7eef48f25d155ef969ff2499ddcfbba3ab0': Filename too long

12:34:13 warning: Could not stat path 'src/node_modules/.cache/uglifyjs-webpack-plugin/content-v2/sha512/ee/c7/bd441fc205977b77141a50fc7765176e5e066c9910d99eac62d78694ecc2e0c4299b93882f5309a7cf0ba7536919c44813622ff635d5af86901a61a86515': Filename too long

any ideas on how to solve this / what has changed to cause this issue with windows?

Our path to jenkins is C:/jenkins/workspace/Project/ so not too long already

@zkat friendly ping

same issue happens to me in folder:
node_modules.cache\uglifyjs-webpack-plugin\content-v2\sha512\9a\e6

Filename too long

What's actually spitting out those warnings? Without context, I don't know what's failing -- but I generally know windows tooling is really bad at dealing with long paths (not necessarily Node itself).

This seems like a good reason to consider shortening these hashes as they used to be. I didn't really think they'd blow right past the path length limit like that but if it's nested inside other already-long paths...

I also have the same issue the hash filename are too long.

/cc @zkat a lot of people faced with this problem, maybe be it is time to solve?

Same problem here. In my case this is happening with webpack's uglify plugin.

Same for me :(. Also webpack's uglify plugin. Any chance for someone to fix it?

/cc @zkat i know what you is part of npm and have a lot of work, but need fix this

any news about that issue?

After thinking about this and looking into it, I've decided that this is not an issue to fix in cacache itself. The uglify plugin can try manually changing the hash algorithm by manually passing in algorithms: ['sha1'] or such. It doesn't need very cryptographically secure algorithms, and changing it to sha1, or even sha256, would possibly remove this problem altogether for most Windows users.

Beyond that, if you're on Windows and using a fairly recent version of npm, you can do $ npx rimraf path/to/node_modules/.cache to blow away these longpathed directories.

If you're having this issue specifically with git, try enabling longpath support in git itself.

That's that! Cheers!

@zkat thanks! I will try your solution!

I have the problem during VS build of an Angular project :(