ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

springboot+vue3搭建项目

2021-04-09 22:33:20  阅读:279  来源: 互联网

标签:node ... springboot app global yarn vue3 create 搭建


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.

标签:node,...,springboot,app,global,yarn,vue3,create,搭建
来源: https://blog.csdn.net/qq_40181007/article/details/115560540

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有