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搭建项目
基础教程推荐
猜你喜欢
- Javascript Bootstrap的网格系统,导航栏和轮播详解 2023-08-11
- 使用ajax跨域调用springboot框架的api传输文件 2023-02-23
- uniapp开发微信小程序自定义顶部导航栏功能实例 2022-10-21
- HTML clearfix清除浮动讲解 2022-11-20
- Ajax发送和接收请求 2022-12-15
- JS滚动到顶部踩坑解决记录 2023-07-10
- 在实战中可能碰到的几种ajax请求方法详解 2023-02-01
- 关于Ajax跨域问题及解决方案详析 2023-02-23
- cocos creator游戏实现loading加载页面,游戏启动加载动画 2022-10-29
- Ajax+smarty技术实现无刷新分页 2022-12-15