springboot+vue3搭建项目yarn创建前端项目1.执行如下命令创建项目yarn create @vitejs/app sut-vue3 --template vueyarn创建项目遇到的问题D:\project\vue_projectyarn create vite-app alex-vue3 --template v...

springboot+vue3搭建项目
yarn创建前端项目
1.执行如下命令创建项目
yarn create @vitejs/app sut-vue3 --template vue
yarn创建项目遇到的问题
D:\project\vue_project>yarn create vite-app alex-vue3 --template vue
yarn create v1.22.10
[1/4] Resolving packages...
warning create-vite-app@1.21.0: create-vite-app has been deprecated. run `npm init @vitejs/app` or `yarn create @vitejs/app` instead.
[2/4] Fetching packages...
info fsevents@1.2.13: The platform "win32" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "@vue/cli > jscodeshift@0.9.0" has unmet peer dependency "@babel/preset-env@^7.1.6".
[4/4] Building fresh packages...
success Installed "create-vite-app@1.21.0" with binaries:
- create-vite-app
- cva
文件名、目录名或卷标语法不正确。
error Command failed.
Exit code: 1
Command: D:\soft\node\node_global\bin\create-vite-app
Arguments: alex-vue3 --template vue
Directory: D:\project\vue_project
Output:
info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
原因
是因为yarn全局安装的位置与yarn的bin文件不在一个磁盘下
$ yarn global bin
D:\soft\node\node_global\bin
$ yarn global dir
C:\Users\majf\AppData\Local\Yarn\Data\global
解决方式:
设置全局信息:
$ yarn config set global-folder "D:\soft\node\yarn_global"
yarn config v1.22.10
success Set "global-folder" to "D:\\soft\\node\\yarn_global".
Done in 0.04s.
设置缓存信息
$ yarn config set cache-folder "D:\soft\node\yarn_cache"
yarn config v1.22.10
success Set "cache-folder" to "D:\\soft\\node\\yarn_cache".
Done in 0.04s.
最后的结果
$ yarn create @vitejs/app alex-vue3 --template vue
yarn create v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "@vitejs/create-app@2.2.3" with binaries:
- create-app
- cva
Scaffolding project in D:\project\vue_project\alex-vue3...
Done. Now run:
cd alex-vue3
yarn
yarn dev
Done in 2.70s.
织梦狗教程
本文标题为:springboot+vue3搭建项目


基础教程推荐
猜你喜欢
- 在IE中为abbr标签加样式 2022-10-16
- ajax实现数据分页查询 2023-01-31
- Unicode中的常用字母小结 2022-09-21
- 原生ajax瀑布流demo分享(必看篇) 2023-02-01
- Ajax提交表单并接收json实例代码 2023-02-13
- 纯javascript的ajax实现php异步提交表单的简单实例 2022-12-28
- 解决:layUI数据表格+简单查询 2022-12-16
- AJax 把拿到的后台数据在页面中渲染的实例 2023-02-22
- JavaScript垃圾回收机制(引用计数,标记清除,性能优 2022-08-31
- 关于ajax异步访问数据的问题 2023-02-23