I've installed yarn in my Windows 10 using the command npm install --global yarn and checked the version using yarn --version , It's showing the version info in the cmd. And then I tried to create a vite app using the command : yarn create vite but It shows the below error in the cmd. Please give me the solution if you know. I tried uninstalling and re-installing yarn but the same error happens. Thank you.
Here is the error in cmd:
C:\DevProjects>yarn create vite
yarn create v1.22.19
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "[email protected]" with binaries:
- create-vite
- cva
[##] 2/2'C:\Users\Graphic' is not recognized as an internal or external command,
operable program or batch file.
error Command failed.
Exit code: 1
Command: C:\Users\Graphic Doctor\AppData\Local\Yarn\bin\create-vite
Arguments:
Directory: C:\DevProjects
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
C:\DevProjects>
I had the same problem and couldn't find a way to solve it through the CLI.
If you really insist on using Vite/Yarn combo, here is how I did it:
Good luck!
building on top of @a-rsv's answer, So I was able to successfully run the command by running as below
"C:\Users\Graphic Doctor\AppData\Local\Yarn\bin\create-vite.cmd"
I just executed the .cmd file.
This will run the cmd in the current directory so you won't have to move anything after. You need to wrap the command with double quotes if you have spaces in the path.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With