微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

当我使用 create 命令时,纱线总是以错误结束

如何解决当我使用 create 命令时,纱线总是以错误结束

每次尝试使用 yarn 运行 create 命令时都会遇到同样的错误,例如 create-react-app:

PS M:\Users\Michael\Documents\GitHub\test> yarn create react-app test-app --template typescript
yarn create v1.22.11
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.2" is an optional dependency and Failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-react-app@4.0.3" with binaries:
      - create-react-app
The filename,directory name,or volume label Syntax is incorrect.
error Command Failed.
Exit code: 1
Command: M:\Users\Michael\Documents\GitHub\test\!\bin\create-react-app
Arguments: test-app --template typescript
Directory: M:\Users\Michael\Documents\GitHub\test
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

也许我需要一些环境变量?

解决方法

此错误来自 Windows。

我通过全局安装 create-react-app 并使用它来创建应用程序而不是 npx 来修复它。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。