Open napei opened 3 years ago
I got the same issue here. My project works fine on Linux systems, but since I'm on Windows 10, and without changing anything, doctor fails with this error.
I found a workaround replacing yarn dlx @yarnpkg/doctor $YOUR_PATH
by yarn dlx @yarnpkg/doctor .\"$YOUR_PATH\"
.
Since I'm not sure it works on Linux and I want to avoid any regression, I made a very small script to check which OS is used, and use the correct value.
# get-cwd.sh
#!/bin/bash
# if Windows, need a small workaround
if [ $OSTYPE == msys ];
then
echo .\"$INIT_CWD\";
else
echo $INIT_CWD;
fi
(thanks to https://stackoverflow.com/a/8597411)
Then in my package.json
{
"scripts": {
"check-deps": "yarn dlx @yarnpkg/doctor $(yarn cwd)",
"cwd": "bash -c scripts/get-cwd.sh"
}
}
I'm not sure this issue is yarn-related, but anyway I hope it helps 👍
Second this issue. The resolution above doesn't work for me either. Doctor is attempting a strict check against the two paths, with one having '/' instead of '\' causing it to fail.
My current work around is switching over to WSL and running doctor.
Hi! 👋
This issue looks stale, and doesn't feature the reproducible
label - which implies that you didn't provide a working reproduction using Sherlock. As a result, it'll be closed in a few days unless a maintainer explicitly vouches for it or you edit your first post to include a formal reproduction (you can use the playground for that).
Note that we require Sherlock reproductions for long-lived issues (rather than standalone git repositories or similar) because we're a small team. Sherlock gives us the ability to check which bugs are still affecting the master branch at any given point, and decreases the amount of code we need to run on our own machines (thus leading to faster bug resolutions). It helps us help you! 😃
If you absolutely cannot reproduce a bug on Sherlock (for example because it's a Windows-only issue), a maintainer will have to manually add the upholded
label. Thanks for helping us triaging our repository! 🌟
This is still an issue!
I'll reopen but without a runnable reproduction we can't really fix it
@merceyz For me it's happened on all the projects I've attempted to run the doctor on so far within Windows.
This looks related: https://github.com/typescript-eslint/typescript-eslint/issues/2705
Experiencing the same issue as above, in Windows (and a monorepo).
Not yet been able to reproduce in isolation.
@merceyz For me it's happened on all the projects I've attempted to run the doctor on so far within Windows.
Same here. I have to use WSL to get the doctor working. Tried on multiple machines with the same result.
I also come with this problem.
However, the actual issue behind my problem is: my json file is invalid.
It's invalid because I applied eslint
on that json file by mistake.
After I fixed the file, the problem just disappeared.
So, maybe there is some problems releated to that json file?
However, look like there is also a bug in typescript's diagnostic logic.
Describe the bug
Ran into an interesting error running
@yarnpkg/doctor
on windows with yarn berry.To Reproduce
I'm not too sure about reproduction, as this happens in my private repo but not in a fresh new repo so apoloigies for not having a concrete repro. I'm working on an Angular 11 applicaiton, and this also happens in another private repo of mine. In general, I did this:
yarn set version berry
yarn dlx @yarnpkg/doctor
Environment:
Windows 10
15.6.0
2.4.0
Additional context
Works fine on WSL (linux) with the same project.