WSL: lstat error when use yarn to install nodejs package
-
Your Windows build number: windows 10 1803
-
What you’re doing and what’s happening: When i use yarn to install nodejs package, it will cause error with
lstat. -
What’s wrong / what should be happening instead:
Error Logs:
Yarn version:
1.6.0
Node version:
8.9.1
Platform:
linux x64
Trace:
Error: ENOENT: no such file or directory, lstat '/mnt/***/node_modules/asynckit/index.js'
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 21
- Comments: 22
fsutil behavior set disablelastaccess 1in PowerShell worked for meStill get errors reported by @Fumler Sometimes it works sometimes it does not. Different files reported missing every time it does not work. New install - npm and yarn installed after
case=offin wls.confOS Name Microsoft Windows 10 Pro Version 10.0.17134 Build 17134 Ubuntu 18.04
Video: https://drive.google.com/file/d/1QWwVblsVIxnopNWu7CeuoYavyFELKv8q/view?usp=sharing
@therealkenc, I’m running on
Microsoft Windows [Version 10.0.17134.286]and still waiting for 1809 to be released. I’m sorry right now I’m not running on 17760. I think I need someone else to help me testing this.Preparing Sample Directory for Testing
Thank you very much for your tips. At the moment, I don’t know how big exactly the directory tree should be to trigger the failure. I’m trying this on a directory,
/mnt/c/Users/nieltg/Projects, which is actually an SSD and contains all of my active projects, which consists of, approximately, 12 Node projects, 3 Django projects, some Go projects, etc.10 out of 10 invocations of the sample program on
/mnt/c/Users/nieltg/Projectshave failed. Here is the snippet of command I used for testing inzsh:Here is the result of
/mnt/c/Users/nieltg/Projects:I’ve also tried this on AvaKathrynShaw/React-16-Demo which can be prepared with these commands:
5 out of 5 invocations of the sample program on it have failed on my machine. Here is the result:
More Things and
straceLogAfter conducting those and more experiments, I found more things:
fs.stats(), like logging, so it does make me harder to debug./home/nieltg, but it only needs ~10 seconds to fail while running on/mnt/c/Users/nieltg/Projectswhich is on DrvFs.stracemake it needs a longer time then withoutstracebefore it failed.async-dirtree-test > /dev/nullwhich discards all of the output it produces so thelstatcalls are made more frequent.case=forcein DrvFs mount options on my machine.From this part of article and from the
stracelogs that I collected from the sample program, I learnt thatlstatsyscall isn’t actually asynchronous and is being called on Node’s worker threads. Here is a portion of thestracelog of a single worker thread:You’re welcome. 😃 And with all of those facts, I wonder whether the C/C++ version will show the same behavior as the Node version. I’m thinking of a simple program which just calls
lstat()andreaddir()recursively until all files in the directory and its descendants are visited and maybe with some threading.The complete
stracelogs are available on this archive and the command I used to harvest them is available below:Summary
Well, it feels that I was just writing an article. Anyway, I think this can be tested by following this guide:
My Documents:Thank you very much. I’m looking forward to more hearing about this.
UPD: seems to be fixed in 1809
@yshterev Are you sure your D:\workspace is a brand new folder created after enabling case=off? You can try on cmd with
fsutil file queryCaseSensitiveInfo D:\workspacefsutil file queryCaseSensitiveInfo D:\workspace\gofsutil file queryCaseSensitiveInfo D:\workspace\go\srcand so on… If some of them say is Enabled then you will have this issue. Otherwise it could be a race condition like #2712Thank you @onomatopellan !
Putting yarn cache location on a Lxfs folder fixed the issue.
I’m having the same issue since the April update, it happens for one project though. The rest of my projects use
yarnand no issues there, other than randomnodemonrestarts.I tried the same project on other machine and it also fails, it fails specifically when running jest tests. Happens on both node 9.8 and 10. Yarn version is 1.6.0