yarn create vite my-vue-app --template vue创建项目报错

根据官方文档的步骤创建项目,报错如下:

success Installed "create-vite@2.7.2" with binaries:
- create-vite
- cva
error An unexpected error occurred: "EPERM: operation not permitted, unlink 'C:\\Program Files\\nodejs\\node_global\\bin\\create-next-app'".
info If you think this is a bug, please open a bug report with the information provided in "C:\\Users\\86181\\AppData\\Local\\Yarn\\Data\\global\\yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.

报错的末尾给了一个网址: https://yarnpkg.com/en/docs/cli/create

打开看了下

翻译一下大意就是,这句命令其实是做了两件事,全局安装了create-vite   用create vite创建项目

大家可以去nodejs下去看下有没有安装上create-vite

这里的命令可以看到是create-vite已经安装上了.但是为什么创建项目会失败呢.这里我也没想明白,难道是用create vite创建项目的?

因为我试了下用create vite my-vue3 --template vue创建项目,结果报错找不到命令

然后换成create-vite my-vue-app --template vue创建就成功了

记录一下,有遇到相同问题的可以看下是否安装了全局命令,然后直接用命令创建项目试试

posted @ 2022-01-06 21:52  潇湘羽西  阅读(2967)  评论(0编辑  收藏  举报