YARN 错误/纱线创建 react-app myapp 错误

问题描述 投票:0回答:1

昨晚我在我的 Windows 操作系统上安装了 Yarn,当我发送命令

yarn create react-app
我有下一个错误:

yarn create v1.22.19
warning ..\..\package.json: No license field
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...

success Installed "[email protected]" with binaries:
      - create-react-app
'C:\Users\NG' is not recognized as an internal or external command,
operable program or batch file.
**error Command failed.**
Exit code: 1
Command: C:\Users\NG By ROG\AppData\Local\Yarn\bin\create-react-app
Arguments: myapp
Directory: C:\Users\NG By ROG\Desktop\REACT
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
PS C:\Users\NG By ROG\Desktop\REACT>

我尝试了 YouTube 上的每个教程,但没有任何效果。

reactjs yarnpkg
1个回答
0
投票

此错误发生在 Windows 上,如果您的用户配置文件/名称中有空格。

解决方案 1:- 尝试创建一个没有任何空间的 Windows 用户 - 示例 - NGByROG2。然后尝试

yarn create

解决方案 2:- 创建文件夹

  1. c:\年
© www.soinside.com 2019 - 2024. All rights reserved.