【vite】使用命令 yarn create vue@latest创建项目时,报错

10 篇文章 0 订阅
3 篇文章 0 订阅
yarn create vue@latest
yarn create v1.22.22
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
[4/4] 🔨  Building fresh packages...

success Installed "create-vue@3.10.4" with binaries:
      - create-vue
/bin/sh: /[地址]/[name]/.npm-global/bin/create-vue@latest: No such file or directory
error Command failed.
Exit code: 127
Command: /[地址]/[name]/.npm-global/bin/create-vue@latest
Arguments: 
Directory: /[地址]/.../[项目地址]
Output:

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

根据提示查看 documentation
https://classic.yarnpkg.com/en/docs/cli/create

再查阅issues发现已经有人发生过同样的问题了
https://github.com/vuejs/create-vue/issues/502

给出的解决方法有两种:

  • 根据回答 Yarn version 1 don't support feature flags, you can upgrade your yarn version to a newer version or remove @latest flag ,
  1. 执行命令的时候 不要添加 @latest
  • yarn create vue 创建项目成功
  1. 升级yarn版本
  • yarn global remove yarn
  • yarn global add yarn
  • 如果要安装最新版本,可以使用 latest
  • yarn global add yarn@latest
  • yarn --version 检查版本
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

起伏羊

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值