Error: UNKNOWN: unknown error, lstat on WSL symbolic links
See original GitHub issueThanks for your effort on this project. I’m using fast-glob in a PHP language server and am getting reports from users about lstat errors. Most of these users are on Windows and are using WSL, though a minority appear not to be using WSL.
This is the issue containing most of the information: https://github.com/bmewburn/vscode-intelephense/issues/260
This may also be useful: https://github.com/Microsoft/WSL/issues/1524
I’m not a Windows user myself but will try and add some further info later.
Environment
Windows
Actual behavior
Error: UNKNOWN: unknown error, lstat 'e:\firma\fbpopular\public\storage'
Expected behavior
No error.
Steps to reproduce
- Try and find files in a dir structure that contains symbolic links on windows WSL
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (5 by maintainers)
Top Results From Across the Web
Nodejs Development - WSL and Windows: Unknown error ...
Solution: In my case, the problem has to do with how npm is connecting dependency scripts to my project. In WSL, npm uses...
Read more >KJS / Gradle: A symlink produced from a wsl linux build ...
The yarn-error.log shows the same issue, that the symlink can't be resolved. ... error An unexpected error occurred: "UNKNOWN: unknown error, lstat ......
Read more >Windows error in meteor
I am getting the following error when creating or running a meteor app. ... throw error; ^ Error: UNKNOWN: unknown error, lstat ......
Read more >failed to create symbolic link - no such file or directory [closed]
Edit: Ok, the problem seems to be that it when the path includes a space, it thinks the name stops at this space...
Read more >Npm errors when installing packages on windows share
Running with --no-bin-links fixed it for me: npm install --no-bin-links. --no-bin-links tells npm to not create any symbolic links.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, after research: the
node-glob
package just ignore error fromlstat
call.This is will be work correctly after #163, but only with Node.js 10.10+. I’ll think about how to handle situation on Node.js below 10.10.
Unfortunately, the correct behavior is only guaranteed for Node.js 10.10+. For the correct operation of the package requires information about what the file in front of us: symbolic link, file or something else. We cannot ignore the
lstat
error, otherwise, there will be inconsistency between modes:string
,dirent
andstat
.So, right now VS Code build with Node.js 10.2.0. The next update was delayed (https://github.com/microsoft/vscode/issues/61787).
I will describe this behavior in the documentation.