-
Notifications
You must be signed in to change notification settings - Fork 304
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
Tests failing only on WSL with 'Cannot find module' #203
Comments
hi @bniedermeyer, have you tried to add those packages in your |
@ahnpnl I have yes and still have the same issue. However the same commands work when run via my IDE's test commands (It's pointing at the same node_modules folder). It's almost like it's a permissions issue within WSL but I can't find a culprit. |
I have the same issue. This is Windows problem..? |
@kazumeat It might be - but I haven't had time to look into it further. I found a workaround to call my tests via my IDE (using webstorm) and have been using that for now. |
I don't use jest-preset-angular but this ticket convinced me I wasn't crazy when I was getting these same random file not found errors.. when running Jest based tests on WSL. I was able to resolve the issues with the latest Windows 10 updates. I think the root cause was this: Hope this helps someone else. |
I had the same issue; resolved when IT allowed me to upgrade my machine to 1903. |
Yeah - I think this is definitely an issue more on the WSL side vs a jest-preset-angular issue. I'm going to close this for now. FWIW if anyone runs across this later I found that if I don't have any processes (e.g my IDE) open to the directory my tests are in the chance for this random failure is much lower. |
A note that after an hour or more of searching, this was the first resource I found that addressed the same issue I was having, so this does seem a valuable resource for anyone working within an environment where they may not have access to latest Windows releases. |
Thanks for reporting the issue as we are also having the issue while using jest with Vue. After trying to blame it for babel and co.. and googling to this thread i think we should upgrade to the latest Windows release. |
Suddenly when running jest in my Angular app within a WSL terminal tests are failing at random with a variation of
Cannot find module
orNo such file
error message pointing at mynode_modules
folder. Note: I rannpm install
within the WSL work space so I don't believe it's an issue of incompatibility between windows and unix installs.e.g.
I have not yet been able to find a pattern that is reproducible - the same tests aren't failing each time. To add even more confusion when I run my tests with my IDE (pointing to the same exact node_modules folder) everything works without issue - and the problem doesn't happen in our CI either. Here is the relevant sections of my
package.json
The text was updated successfully, but these errors were encountered: