报错:
文件名、目录名或卷标语法不正确。 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"
成功
报错倒回