acan
2025 年4 月 2 日 00:54
1
D:\code\robot>yarn create koishi
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-koishi@6.3.2” with binaries:
- create-koishi
文件名、目录名或卷标语法不正确。
error Command failed.
Exit code: 1
Command: D:\App\nodeJs\bin\create-koishi
Arguments:
Directory: D:\code\robot
Output:
info Visit yarn create | Yarn for documentation about this command.
报错说是目录有问题,但是我这也没中文没空格啊
2 个赞
acan
2025 年4 月 2 日 08:09
2
还有一个错误忘记说了…这是在管理员模式下打开cmd得到的,如果不是管理员模式打开就会这样报错
C:\dev>yarn create koishi
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-koishi@6.3.2” with binaries:
- create-koishi
error Error: EPERM: operation not permitted, unlink ‘D:\App\nodeJs\bin\create-koishi’
info Visit yarn create | Yarn for documentation about this command.
2 个赞
acan
2025 年4 月 4 日 06:42
3
终于找到解决的办法了,帖子一开始遇到的问题(文件名…不正确)是因为yarn的安装包目录和bin目录不在统一磁盘下,可以通过下面命令来查看
#查看bin目录
yarn global bin
#查看安装包目录
yarn global dir
通过下面命令来修改
yarn config set global-folder "D:\yarn\global"
yarn config set cache-folder "D:\yarn\cache"
第二个问题(error Error: EPERM: operation not permitted, unlink…)是因为下载yarn的时候网络有问题,丢文件了,把yarn直接删了重新下一遍就好
2 个赞