dcloudio / uni-ui

基于uni-app的、全端兼容的、高性能UI框架
https://uniapp.dcloud.io/component/uniui/uni-ui.html
Apache License 2.0
1.86k stars 665 forks source link

创建新uni-app项目之后安装uni-ui得到大量警告, 并且也无法使用 #924

Closed ZZH-Finalize closed 1 month ago

ZZH-Finalize commented 2 months ago

创建新项目:

  1. 执行vue create -p dcloudio/uni-preset-vue test
  2. 选择默认模板

得到结果:

Vue CLI v5.0.8
✨  Creating project in D:\proj\uni-app\test.
🗃  Initializing git repository...
⚙️  Installing CLI plugins. This might take a while...

added 934 packages in 50s

99 packages are looking for funding
  run `npm fund` for details
🚀  Invoking generators...

Preset options:
? 请选择 uni-app 模板 默认模板
📦  Installing additional dependencies...

added 1061 packages, and changed 1 package in 51s

116 packages are looking for funding
  run `npm fund` for details
⚓  Running completion hooks...

📄  Generating README.md...

🎉  Successfully created project test.
👉  Get started with the following commands:

 $ cd test
 $ npm run serve

此时使用

cd test
npm run serve

之后, 浏览器访问http://localhost:8080/, 可以看到app在工作, 下一步安装uni-ui

在test路径下执行npm install @dcloudio/uni-ui

得到执行结果:

npm warn ERESOLVE overriding peer dependency
npm warn While resolving: url-loader@2.3.0
npm warn Found: webpack@5.92.1
npm warn node_modules/webpack
npm warn   peer webpack@"^3.0.0 || ^4.1.0 || ^5.0.0-0" from vue-loader@15.11.1
npm warn   node_modules/@hap-toolkit/dsl-vue/node_modules/vue-loader
npm warn     vue-loader@"^15.6.4" from @hap-toolkit/dsl-vue@0.6.13
npm warn     node_modules/@hap-toolkit/dsl-vue
npm warn   17 more (@soda/friendly-errors-webpack-plugin, ...)
npm warn
npm warn Could not resolve dependency:
npm warn peer webpack@"^4.0.0" from url-loader@2.3.0
npm warn node_modules/url-loader
npm warn   url-loader@"^2.1.0" from @hap-toolkit/dsl-vue@0.6.13
npm warn   node_modules/@hap-toolkit/dsl-vue
npm warn
npm warn Conflicting peer dependency: webpack@4.47.0
npm warn node_modules/webpack
npm warn   peer webpack@"^4.0.0" from url-loader@2.3.0
npm warn   node_modules/url-loader
npm warn     url-loader@"^2.1.0" from @hap-toolkit/dsl-vue@0.6.13
npm warn     node_modules/@hap-toolkit/dsl-vue
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated gauge@3.0.2: This package is no longer supported.
npm warn deprecated puppeteer@3.3.0: < 22.6.4 is no longer supported

added 93 packages, removed 5 packages, changed 1 package, and audited 2084 packages in 4m

116 packages are looking for funding
  run `npm fund` for details

68 vulnerabilities (5 low, 30 moderate, 27 high, 6 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
bfc846958672 commented 1 month ago

用最新hbuilderX编辑器来初始化 uniapp项目吧,可以选择带有uni-ui的模板。

ZZH-Finalize commented 1 month ago

好, 我试一下, 谢谢

ZZH-Finalize commented 1 month ago

你说的uni-app自建脚手架是指这个吗? image

看起来这个工具并没有创建项目和安装包的功能

bfc846958672 commented 1 month ago

稍等,我这边看下这个问题

bfc846958672 commented 1 month ago

安装uni-ui 官方流程 : https://uniapp.dcloud.net.cn/component/uniui/quickstart.html

你好,我这边可以正常使用,除了安装 @dcloudio/uni-ui 包,以外还需要一些其他依赖项,主要流程为

  1. 安装sass: npm i sass
  2. 安装sass-loader: npm i sass-loader@10.1.1 -D
  3. 安装uni-ui: npm i @dcloudio/uni-ui
  4. 配置easycom, ` // pages.json { "easycom": { "autoscan": true, "custom": { // uni-ui 规则如下配置 "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue" } },

    // 其他内容 pages:[ // ... ] } ` 然后就能用了 详情可以看一下 官方流程 https://uniapp.dcloud.net.cn/component/uniui/quickstart.html

ZZH-Finalize commented 1 month ago

好的, 我试一下, 谢谢

ZZH-Finalize commented 1 month ago

安装uni-ui 官方流程 : https://uniapp.dcloud.net.cn/component/uniui/quickstart.html

你好,我这边可以正常使用,除了安装 @dcloudio/uni-ui 包,以外还需要一些其他依赖项,主要流程为

  1. 安装sass: npm i sass
  2. 安装sass-loader: npm i sass-loader@10.1.1 -D
  3. 安装uni-ui: npm i @dcloudio/uni-ui
  4. 配置easycom, // pages.json { "easycom": { "autoscan": true, "custom": { // uni-ui 规则如下配置 "^uni-(.*)": "@dcloudio/uni-ui/lib/uni-$1/uni-$1.vue" } }, // 其他内容 pages:[ // ... ] } 然后就能用了 详情可以看一下 官方流程 https://uniapp.dcloud.net.cn/component/uniui/quickstart.html

您的方法我试过了, 确实是可以用的, 但是还是有很多警告, 这个可以不管吗, 我执行npm install的时候是加上 --no-audit 和 --no-fond两个flag才行的

bfc846958672 commented 1 month ago

不影响uni-ui正常使用即可