1
0
Code Issues Pull Requests Packages Projects Releases Wiki Activity GitHub Gitee

前端项目可以跑起来了

This commit is contained in:
2022-10-21 15:48:56 +08:00
parent e1f570ed9f
commit 7997691f77
8 changed files with 539 additions and 10 deletions

View File

@@ -2,7 +2,79 @@
### 2022.10
#### 2022.10.21 项目创建后启动失败提示Failed to configure a DataSource: url attribute is not specified and no embedded datasource could be configured.
#### 2022.10.21 前端 npm run serve 时报错提示Module not found: Error: Can't resolve 'element-plus/lib/locale'
```bash
ERROR Failed to compile with 1 error
error in ./src/plugins/element.js
Module not found: Error: Can't resolve 'element-plus/lib/locale' in 'xxxxxxxx\src\plugins'
ERROR in ./src/plugins/element.js 3:0-45
Module not found: Error: Can't resolve 'element-plus/lib/locale' in 'xxxxxxxx\src\plugins'
@ ./src/main.js 4:0-51 6:0-18
webpack compiled with 1 error
```
解决方案:
安装`unplugin-vue-components``unplugin-auto-import`这两款插件
```bash
npm install -D unplugin-vue-components unplugin-auto-import
```
注意:安装时可能还会遇到下面一个错误,可以添加 `--legacy-peer-deps` 参数解决
参考https://element-plus.gitee.io/zh-CN/guide/quickstart.html#%E6%8C%89%E9%9C%80%E5%AF%BC%E5%85%A5
#### 2022.10.21 前端 npm install 时报错提示Conflicting peer dependency: eslint-plugin-vue@7.20.0
```bash
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: @vue/eslint-config-standard@6.1.0
npm ERR! Found: eslint-plugin-vue@8.7.1
npm ERR! node_modules/eslint-plugin-vue
npm ERR! dev eslint-plugin-vue@"^8.0.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint-plugin-vue@7.20.0
npm ERR! node_modules/eslint-plugin-vue
npm ERR! peer eslint-plugin-vue@"^7.0.0" from @vue/eslint-config-standard@6.1.0
npm ERR! node_modules/@vue/eslint-config-standard
npm ERR! dev @vue/eslint-config-standard@"^6.1.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\Coz\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Coz\AppData\Local\npm-cache\_logs\2022-10-21T07_12_41_027Z-debug-0.log
```
解决方案:
在安装命令后加 `--legacy-peer-deps`
例如:`npm i --legacy-peer-deps`
参考https://blog.csdn.net/lanmy_dl/article/details/126346812
#### 2022.10.21 后端 项目创建后启动失败提示Failed to configure a DataSource: url attribute is not specified and no embedded datasource could be configured.
```bash
***************************