嘗試時發生錯誤:yarn create vite /yarn create vite my-react-app --template react
<p>我已經使用命令<code>npm install --global yarn</code> 在Windows 10 中安裝了紗線,並使用<code>yarn --version</code> 檢查了版本,它顯示了版本資訊在命令中。然後我嘗試使用以下命令建立一個 vite 應用程式:<code>yarn create vite</code> 但它在 cmd 中顯示以下錯誤。如果您知道請給我解決方案。我嘗試卸載並重新安裝yarn,但發生了同樣的錯誤。謝謝。 </p>
<p>這是cmd中的錯誤:</p>
<pre class="brush:php;toolbar:false;">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></pre></p>