Error when trying: yarn create vite /yarn create vite my-react-app --template react
P粉764003519
P粉764003519 2023-08-29 22:59:32
0
1
588

I have installed yarn in Windows 10 using the command npm install --global yarn and checked the version using yarn --version and it Shows the version information in the command. Then I tried to create a vite application using the following command: yarn create vite but it showed the following error in cmd. If you know please give me the solution. I tried uninstalling and reinstalling yarn but the same error occurred. Thanks.

This is an 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 "create-vite@4.3.2" 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>

P粉764003519
P粉764003519

reply all (1)
P粉511985082

I had the same problem but couldn't find a way to solve it via CLI.

If you really insist on using the Vite/Yarn combo, here’s how I do it:

  1. Manually go to (this is the directory in your question) C:\Users\Graphic Doctor\AppData\Local\Yarn\bin\create-vite and manually start create-vite.cmd
  2. A new command prompt window will pop up, just follow the instructions.
  3. Once completed, your project will be ready and located in C:\Users\Graphic Doctor\AppData\Local\Yarn\bin, just manually move it to your preferred location.

Good luck!

    Latest Downloads
    More>
    Web Effects
    Website Source Code
    Website Materials
    Front End Template
    About us Disclaimer Sitemap
    php.cn:Public welfare online PHP training,Help PHP learners grow quickly!