yarn报“文件名、目录名或卷标语法不正确”错误的解决方案

报错:
文件名、目录名或卷标语法不正确。 error Command failed. Exit code: 1 Command: D:\tool\installation\nodejs\node_global

PS D:\tool\vue\workspace\03_vue> yarn create vue
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-vue@3.6.1" with binaries:
      - create-vue
[##] 2/2文件名、目录名或卷标语法不正确。
error Command failed.
Command: D:\tool\installation\nodejs\node_global\bin\create-vue
Arguments:
Directory: D:\tool\vue\workspace\03_vue
Output:

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

原因:电脑yarn bin目录和安装的模块在不同的硬盘分区里面导致的,因为 yarn 默认安装在C盘(即运行缓存数据和安装目录都在C盘)了。重点是要将yarn bin目录和安装的模块放在相同的硬盘分区里面。

解决代码

 yarn global bin
 yarn global dir
 yarn config set global-folder "D:\tool\installation\yarn\global"
 yarn config set cache-folder "D:\tool\installation\yarn\cache"  

在这里插入图片描述
成功
在这里插入图片描述
报错倒回
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

云浩舟

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

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

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

打赏作者

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

抵扣说明:

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

余额充值