uni-app icon indicating copy to clipboard operation
uni-app copied to clipboard

npx @dcloudio/uvm 命令无效

Open monyee opened this issue 3 years ago • 2 comments

问题描述 如题 无法更新依赖

复现步骤

  1. cli 方式通过

npx degit dcloudio/uni-preset-vue#vite-ts my-vue3-project 生产ts项目后,安装依赖正常运行

  1. 通过下面命令 npx @dcloudio/uvm 正常执行没有报错,有warning

` randy@randydeMacBook-Pro uni-retailo2o % npx @dcloudio/uvm
? Select Package Manager pnpm Already up-to-date  WARN  Issues with peer dependencies found . └─┬ @dcloudio/uni-app └─┬ @dcloudio/uni-cloud └─┬ @dcloudio/uni-cli-shared ├─┬ autoprefixer │ └── ✕ missing peer postcss@^8.1.0 ├─┬ postcss-import │ └── ✕ missing peer postcss@^8.0.0 ├─┬ postcss-load-config │ └── ✕ missing peer postcss@>=8.0.9 └─┬ postcss-modules ├── ✕ missing peer postcss@^8.0.0 ├─┬ postcss-modules-extract-imports │ └── ✕ missing peer postcss@^8.1.0 ├─┬ postcss-modules-local-by-default │ ├── ✕ missing peer postcss@^8.1.0 │ └─┬ icss-utils │ └── ✕ missing peer postcss@^8.1.0 ├─┬ postcss-modules-scope │ └── ✕ missing peer postcss@^8.1.0 └─┬ postcss-modules-values └── ✕ missing peer postcss@^8.1.0 Peer dependencies that should be installed: postcss@">=8.1.0 <9.0.0"

Progress: resolved 416, reused 203, downloaded 0, added 0, done Already up-to-date  WARN  Issues with peer dependencies found . └─┬ @dcloudio/uni-automator └─┬ @dcloudio/uni-cli-shared ├─┬ autoprefixer │ └── ✕ missing peer postcss@^8.1.0 ├─┬ postcss-import │ └── ✕ missing peer postcss@^8.0.0 ├─┬ postcss-load-config │ └── ✕ missing peer postcss@>=8.0.9 └─┬ postcss-modules ├── ✕ missing peer postcss@^8.0.0 ├─┬ postcss-modules-extract-imports │ └── ✕ missing peer postcss@^8.1.0 ├─┬ postcss-modules-local-by-default │ ├── ✕ missing peer postcss@^8.1.0 │ └─┬ icss-utils │ └── ✕ missing peer postcss@^8.1.0 ├─┬ postcss-modules-scope │ └── ✕ missing peer postcss@^8.1.0 └─┬ postcss-modules-values └── ✕ missing peer postcss@^8.1.0 Peer dependencies that should be installed: postcss@">=8.1.0 <9.0.0"

Progress: resolved 347, reused 203, downloaded 0, added 0, done `

预期结果 npx @dcloudio/uvm 可以更新依赖到最新正式版

实际结果 无效依赖未改变,依旧是模板默认依赖

"devDependencies": { "@dcloudio/types": "^3.0.7", "@dcloudio/uni-automator": "3.0.0-alpha-3050320220727002", "@dcloudio/uni-cli-shared": "3.0.0-alpha-3050320220727002", "@dcloudio/uni-stacktracey": "3.0.0-alpha-3050320220727002", "@dcloudio/vite-plugin-uni": "3.0.0-alpha-3050320220727002", "sass": "^1.54.3", "typescript": "^4.7.4", "vite": "^2.9.14" }

系统信息:

  • 发行平台: cli
  • 操作系统: mac os 11.4

monyee avatar Aug 08 '22 10:08 monyee

这是pnpm的报错,项目的某个依赖把自己的依赖postcss写在了 peer dependencies 中。 删除pnpm-lock.yaml,重新使用pnpm安装依赖时,就会提示:

hint: If you want peer dependencies to be automatically installed, add "auto-install-peers=true" to an .npmrc file at the root of your project. hint: If you don't want pnpm to fail on peer dependency issues, add "strict-peer-dependencies=false" to an .npmrc file at the root of your project.

提示信息已经给出了解决办法。 或者你也可以pnpm add postcss -D 来解决

wtto00 avatar Aug 09 '22 02:08 wtto00

这是pnpm的报错,项目的某个依赖把自己的依赖postcss写在了 peer dependencies 中。 删除pnpm-lock.yaml,重新使用pnpm安装依赖时,就会提示:

hint: If you want peer dependencies to be automatically installed, add "auto-install-peers=true" to an .npmrc file at the root of your project. hint: If you don't want pnpm to fail on peer dependency issues, add "strict-peer-dependencies=false" to an .npmrc file at the root of your project.

提示信息已经给出了解决办法。 或者你也可以pnpm add postcss -D 来解决

试了下依赖还是没更新

monyee avatar Aug 09 '22 08:08 monyee

uvm 仅管理 uni- 相关依赖的版本,不处理其他依赖的版本。

按楼上说的手动安装 postcss 后仍然有警告吗?

zhetengbiji avatar Aug 25 '22 07:08 zhetengbiji

image

image

没有warning, 期望能升级到最新版本 比如 3.5.4.20220805

monyee avatar Aug 26 '22 02:08 monyee

image

image

没有warning, 期望能升级到最新版本 比如 3.5.4.20220805

如果希望升级到alpha对应版本加上参数即可 npx @dcloudio/uvm alpha 更多用法见文档

zhetengbiji avatar Aug 26 '22 03:08 zhetengbiji