fix(manager端升级node版本): 更新多个组件的样式,替换 /deep/ 选择器为 ::v-deep,替换 node-sass 为 sass,优化依赖管理和兼容性,兼容node16版本

This commit is contained in:
Ryan Ran
2025-09-30 11:38:38 +08:00
parent 16c4a78e29
commit ae85f0d612
45 changed files with 161 additions and 93 deletions

1
manager/.npmrc Normal file
View File

@@ -0,0 +1 @@
engine-strict=false

1
manager/.yarnrc Normal file
View File

@@ -0,0 +1 @@
--ignore-engines true

View File

@@ -1,29 +1,90 @@
# LILISHOP-UI
## Project setup
```
npm install
```
# LiliShop UI Manager 的 Node.js 版本兼容性
### Compiles and hot-reloads for development
```
npm run serve
```
本文档概述了 LiliShop UI seller 项目的 Node.js 版本兼容性。
### Compiles and minifies for production
```
npm run build
```
## 摘要
### Run your tests
```
npm run test
```
| Node.js 版本 | npm 版本 | 兼容性 | 备注 |
|-----------------|-------------|--------------|-------|
| v20.13.1 (当前 LTS) | 10.8.0 | ✅ 需要解决方案 | 安装需要 `--legacy-peer-deps` 参数,运行需要 `NODE_OPTIONS=--openssl-legacy-provider` |
| v18.20.8 (LTS) | 10.8.2 | ✅ 需要解决方案 | 安装需要 `--legacy-peer-deps` 参数,运行需要 `NODE_OPTIONS=--openssl-legacy-provider` |
| v16.20.2 (LTS) | 8.19.4 | ✅ 有轻微警告 | 安装需要 `--legacy-peer-deps` 参数,整体运行良好 |
| v14.x (最低版本) | - | ❌ 不兼容 | 无法在 ARM64 架构上安装 (M系列 Mac) |
## 详细发现
### Node.js v20.13.1 (当前 LTS)
- **安装**: 使用 `--legacy-peer-deps` 参数可以正常安装
- **开发服务器**: 需要设置 `NODE_OPTIONS=--openssl-legacy-provider` 环境变量
- **构建**: 需要设置 `NODE_OPTIONS=--openssl-legacy-provider` 环境变量
- **问题**:
- vue-awesome-swiper 和 swiper 之间的依赖冲突
- 由于 Node.js v20 移除了旧版加密算法导致的 OpenSSL 相关错误
- 部分包报告不支持的引擎警告
- **验证**: 已成功构建并验证 dist/index.html 可以正常运行
### Node.js v18.20.8 (LTS)
- **安装**: 使用 `--legacy-peer-deps` 参数可以正常安装
- **开发服务器**: 需要设置 `NODE_OPTIONS=--openssl-legacy-provider` 环境变量
- **构建**: 需要设置 `NODE_OPTIONS=--openssl-legacy-provider` 环境变量
- **问题**:
- 部分包报告不支持的引擎警告 (v-click-outside-x, @achrinza/node-ipc)
- **验证**: 已成功构建并验证 dist/index.html 可以正常运行
### Node.js v16.20.2 (LTS)
- **安装**: 使用 `--legacy-peer-deps` 参数可以正常安装
- **开发服务器**: 无需额外参数即可运行
- **构建**: 可以正常构建
- **问题**:
- v-click-outside-x 包有轻微警告 (需要 npm 6.4.1)
### Node.js v14.x
- **安装**: 在 ARM64 架构 (M系列 Mac) 上无法安装
- **开发服务器**: 未测试
- **构建**: 可以正常构建
- **问题**:
- Node.js v14 没有 ARM64 架构的二进制文件
## 建议
1. **最佳版本**: Node.js v16.20.2 配合 npm 8.19.4
- 与项目依赖最兼容
- 需要的解决方案最少
- 性能稳定
2. **安装命令**:
```bash
npm install --legacy-peer-deps
```
3. **开发命令**:
```bash
# 对于 Node.js v16
npm run dev
# 对于 Node.js v18 或 v20
NODE_OPTIONS=--openssl-legacy-provider npm run dev
或者 npm run dev
```
4. **生产构建命令**:
```bash
# 对于 Node.js v16
npm run build
# 对于 Node.js v18 或 v20
NODE_OPTIONS=--openssl-legacy-provider npm run build
或者 npm run dev
```
## 未来考虑
1. 更新依赖以兼容较新的 Node.js 版本
2. 解决对等依赖冲突
3. 更新 package.json 以指定推荐的 Node.js 版本范围
### Lints and fixes files
```
npm run lint
```
### Customize configuration
详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/).

View File

@@ -5,9 +5,12 @@
"description": "lilishop-ui",
"author": "lili-platform",
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"dev": "vue-cli-service serve"
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build",
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve"
},
"engines": {
"node": ">=14"
},
"dependencies": {
"@amap/amap-jsapi-loader": "0.0.7",
@@ -16,8 +19,9 @@
"core-js": "^3.6.5",
"dplayer": "^1.26.0",
"js-cookie": "^2.2.1",
"node-sass": "^4.14.1",
"sass-loader": "^8.0.2",
"price-color": "1.0.2",
"sass": "^1.63.6",
"sass-loader": "^10.4.1",
"sockjs-client": "^1.4.0",
"swiper": "^6.3.5",
"uuid": "^8.3.2",
@@ -31,8 +35,7 @@
"vue-router": "^3.1.3",
"vuedraggable": "^2.23.2",
"vuex": "^3.4.0",
"xss": "^1.0.7",
"price-color":"1.0.2"
"xss": "^1.0.7"
},
"devDependencies": {
"@vue/cli-plugin-babel": "^4.4.4",
@@ -50,6 +53,8 @@
"vue-template-compiler": "^2.6.10"
},
"resolutions": {
"minimatch": "^3.1.2"
"minimatch": "^3.1.2",
"node-sass": "npm:sass@^1.63.6",
"@achrinza/node-ipc": "9.2.2"
}
}

View File

@@ -57,11 +57,11 @@ export default {
};
</script>
<style scoped lang="scss">
/deep/ .ivu-modal {
::v-deep .ivu-modal {
overflow: hidden;
height: 650px !important;
}
/deep/ .ivu-modal-body {
::v-deep .ivu-modal-body {
width: 100%;
height: 500px;
overflow: hidden;

View File

@@ -86,11 +86,11 @@ export default {
};
</script>
<style scoped lang="scss">
/deep/ .ivu-modal {
::v-deep .ivu-modal {
overflow: hidden;
height: 650px !important;
}
/deep/ .ivu-modal-body {
::v-deep .ivu-modal-body {
width: 100%;
height: 500px;
overflow: hidden;

View File

@@ -122,11 +122,11 @@ export default {
width: 100%;
}
/deep/ .ivu-modal {
::v-deep .ivu-modal {
overflow: hidden;
height: 650px !important;
}
/deep/ .ivu-modal-body {
::v-deep .ivu-modal-body {
width: 100%;
height: 500px;
overflow: hidden;

View File

@@ -42,12 +42,12 @@
}
}
/deep/ .ivu-scroll-container {
::v-deep .ivu-scroll-container {
width: 100% !important;
height: 400px !important;
}
/deep/ .ivu-scroll-content {
::v-deep .ivu-scroll-content {
/* */
display: flex;
flex-wrap: wrap;
@@ -81,7 +81,7 @@
align-items: center;
margin: 10px;
/deep/ img {
::v-deep img {
width: 60px;
height: 60px;
text-align: center;

View File

@@ -420,7 +420,7 @@ img {
overflow: auto;
width: 100%;
}
/deep/ .ivu-table-wrapper {
::v-deep .ivu-table-wrapper {
width: 100%;
}
.list {

View File

@@ -157,7 +157,7 @@ export default {
text-align: center;
transition: 0.35s;
cursor: pointer;
/deep/ p {
::v-deep p {
margin: 10px 0;
}
border: 1px solid #ededed;

View File

@@ -33,7 +33,7 @@ export default {
};
</script>
<style lang="scss" scoped>
/deep/ .ivu-card-body {
::v-deep .ivu-card-body {
height: 414px;
overflow: auto;
}
@@ -69,11 +69,11 @@ export default {
height: 416px;
overflow: hidden;
}
/deep/ .ivu-table {
::v-deep .ivu-table {
height: 300px !important;
overflow: auto;
}
/deep/ .ivu-card-body {
::v-deep .ivu-card-body {
padding: 0;
height: auto;
}

View File

@@ -137,7 +137,7 @@ img {
overflow: auto;
width: 100%;
}
/deep/ .ivu-table-wrapper {
::v-deep .ivu-table-wrapper {
width: 100%;
}
.list {

View File

@@ -543,7 +543,7 @@ export default {
};
</script>
<style lang="scss" scoped>
/deep/ .ivu-table-wrapper {
::v-deep .ivu-table-wrapper {
overflow: auto;
}
.table {

View File

@@ -10,7 +10,7 @@ h4 {
margin: 20px 0;
font-size: 18px;
}
/deep/ .ivu-icon {
::v-deep .ivu-icon {
margin-left: 40px;
margin-right: 40px;
}

View File

@@ -66,16 +66,16 @@ export default {
};
</script>
<style scoped lang="scss">
/deep/ .ivu-select-dropdown {
::v-deep .ivu-select-dropdown {
text-align: left;
}
.message-con {
margin-right: 10px;
}
/deep/ .ivu-dropdown-item{
::v-deep .ivu-dropdown-item{
padding: 7px 20px !important;
}
/deep/ .ivu-badge-count{
::v-deep .ivu-badge-count{
right: -10px !important;
}
</style>

View File

@@ -49,7 +49,7 @@ export default {
this.selectNav(val.meta.firstRouterName)
}
}
}
}
},
methods: {
changeMenu(name) { //二级路由点击
@@ -90,7 +90,7 @@ export default {
.ivu-menu-dark.ivu-menu-vertical .ivu-menu-item-active:not(.ivu-menu-submenu), .ivu-menu-dark.ivu-menu-vertical .ivu-menu-submenu-title-active:not(.ivu-menu-submenu){
color: $theme_color;
}
/deep/.ivu-menu-vertical .ivu-menu-item-group-title {
::v-deep.ivu-menu-vertical .ivu-menu-item-group-title {
height: 40px;
line-height: 40px;
padding-left: 20px;

View File

@@ -6,7 +6,7 @@
<Form-item label="会员ID" prop="id">
<Input type="text" v-model="searchForm.id" placeholder="请输入会员ID" clearable style="width: 240px" />
</Form-item>
<Form-item label="会员名称" prop="username">
<Input type="text" v-model="searchForm.username" placeholder="请输入会员名称" clearable style="width: 240px" />
</Form-item>
@@ -546,10 +546,10 @@ export default {
};
</script>
<style lang="scss" scoped>
/deep/ .ivu-table-wrapper {
::v-deep .ivu-table-wrapper {
width: 100%;
}
/deep/ .ivu-card {
::v-deep .ivu-card {
width: 100%;
}
.face {

View File

@@ -371,7 +371,7 @@ export default {
.search {
width: 460px;
margin: 0 auto;
/deep/ .ivu-input.ivu-input-large {
::v-deep .ivu-input.ivu-input-large {
border: 2px solid $theme_color;
font-size: 12px;
height: 34px;
@@ -379,7 +379,7 @@ export default {
box-shadow: none;
}
}
/deep/ .ivu-input-group-append {
::v-deep .ivu-input-group-append {
border: 1px solid $theme_color;
border-left: none;
height: 30px;

View File

@@ -1,4 +1,4 @@
/deep/ .ivu-modal-mask,
::v-deep .ivu-modal-mask,
.ivu-modal-wrap {
z-index: 800;
}

View File

@@ -84,7 +84,7 @@
text-align: center;
font-weight: bold;
line-height: 2;
/deep/ img {
::v-deep img {
margin: 0 auto;
}
}

View File

@@ -128,7 +128,7 @@ export default {
}
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 70px !important;
}
@@ -138,7 +138,7 @@ export default {
}
.label-btns {
/deep/ .ivu-btn {
::v-deep .ivu-btn {
margin-right: 10px;
}
}

View File

@@ -1,4 +1,4 @@
/deep/ .ivu-input{
::v-deep .ivu-input{
width: 200px !important;
}
@@ -16,7 +16,7 @@
margin-right: 10px;
}
/deep/ .ivu-form-item-content {
::v-deep .ivu-form-item-content {
margin-left: 0 !important;
display: flex;
}

View File

@@ -116,7 +116,7 @@ export default {
width:500px;
justify-content:space-between;
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 100px !important;
}
.ivu-input-wrapper {

View File

@@ -188,7 +188,7 @@ export default {
}
}
/deep/ .upload-list {
::v-deep .upload-list {
img {
width: 100%;
height: 100%;

View File

@@ -236,7 +236,7 @@ export default {
<style lang="scss" scoped>
.action {
display: flex;
/deep/ .ivu-btn {
::v-deep .ivu-btn {
margin: 0 5px !important;
}
}

View File

@@ -287,7 +287,7 @@ div.base-info-item {
}
/*teatarea*/
/deep/ .el-textarea {
::v-deep .el-textarea {
width: 150%;
}
@@ -315,11 +315,11 @@ div.base-info-item {
/*图片上传组件第一张图设置封面*/
.goods-images {
/deep/ li.el-upload-list__item:first-child {
::v-deep li.el-upload-list__item:first-child {
position: relative;
}
/deep/ li.el-upload-list__item:first-child:after {
::v-deep li.el-upload-list__item:first-child:after {
content: "封";
color: #fff;
font-weight: bold;

View File

@@ -213,7 +213,7 @@ export default {
};
</script>
<style lang="scss" scoped>
/deep/ .ivu-col {
::v-deep .ivu-col {
min-height: 100vh;
}
</style>

View File

@@ -862,7 +862,7 @@ export default {
z-index: 9;
}
/deep/ .ivu-tabs-bar {
::v-deep .ivu-tabs-bar {
margin: 0;
}

View File

@@ -782,7 +782,7 @@ export default {
z-index: 2;
}
}
/deep/ .box {
::v-deep .box {
color: #fff;
position: absolute;

View File

@@ -123,7 +123,7 @@ export default {
margin-right: 10px;
display: flex;
margin-bottom: 20px;
/deep/ .ivu-card-body {
::v-deep .ivu-card-body {
padding: 0 16px !important;
}
}

View File

@@ -133,7 +133,7 @@ export default {
margin-right: 20px;
display: flex;
margin-bottom: 20px;
/deep/ .ivu-card-body {
::v-deep .ivu-card-body {
padding: 0 16px !important;
}
}
@@ -151,7 +151,7 @@ export default {
padding-bottom: 10px;
flex-direction: column;
align-items: center;
/deep/ .ivu-btn {
::v-deep .ivu-btn {
width: 100px;
}
}

View File

@@ -132,7 +132,7 @@ export default {
margin-right: 20px;
display: flex;
margin-bottom: 20px;
/deep/ .ivu-card-body {
::v-deep .ivu-card-body {
padding: 0 16px !important;
}
}
@@ -150,7 +150,7 @@ export default {
padding-bottom: 10px;
flex-direction: column;
align-items: center;
/deep/ .ivu-btn {
::v-deep .ivu-btn {
width: 100px;
}
}

View File

@@ -90,12 +90,12 @@ export default {
display: flex;
}
.w200 {
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 250px !important;
margin: 0 10px;
}
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 450px !important;
margin: 0 10px;
}

View File

@@ -151,7 +151,7 @@ export default {
margin-right: 20px;
display: flex;
margin-bottom: 20px;
/deep/ .ivu-card-body {
::v-deep .ivu-card-body {
padding: 0 16px !important;
}
}

View File

@@ -118,13 +118,13 @@ export default {
}
.w200 {
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 250px !important;
margin: 0 10px;
}
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 450px !important;
margin: 0 10px;
}

View File

@@ -188,7 +188,7 @@ export default {
.label-item {
display: flex;
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 100px !important;
}
</style>

View File

@@ -74,7 +74,7 @@ export default {
display: flex;
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 300px !important;
margin: 0 10px;
}

View File

@@ -113,7 +113,7 @@ export default {
display: flex;
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 300px !important;
margin: 0 10px;
}

View File

@@ -124,7 +124,7 @@ export default {
margin-right: 10px;
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 100px !important;
}

View File

@@ -161,7 +161,7 @@ export default {
display: flex;
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 300px !important;
margin: 0 10px;
}

View File

@@ -172,7 +172,7 @@ export default {
}
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 70px !important;
}
@@ -182,7 +182,7 @@ export default {
}
.label-btns {
/deep/ .ivu-btn {
::v-deep .ivu-btn {
margin-right: 10px;
}
}

View File

@@ -160,7 +160,7 @@ export default {
display: flex;
}
/deep/ .ivu-input {
::v-deep .ivu-input {
width: 300px !important;
margin: 0 10px;
}

View File

@@ -98,7 +98,7 @@ export default {
<style lang="scss" scoped>
@import "./style.scss";
/deep/ .ivu-form-item-content{
::v-deep .ivu-form-item-content{
align-items: center;
padding-bottom: 5px;
}

View File

@@ -1,4 +1,4 @@
/deep/ .ivu-input{
::v-deep .ivu-input{
width: 200px !important;
}
@@ -21,7 +21,7 @@
margin-right: 10px;
}
/deep/ .ivu-form-item-content {
::v-deep .ivu-form-item-content {
margin-left: 0 !important;
display: flex;
}

View File

@@ -66,7 +66,7 @@
# 对于 Node.js v18 或 v20
NODE_OPTIONS=--openssl-legacy-provider npm run dev
或者 npm run dev:18
或者 npm run dev
```
4. **生产构建命令**:
@@ -76,7 +76,7 @@
# 对于 Node.js v18 或 v20
NODE_OPTIONS=--openssl-legacy-provider npm run build
或者 npm run dev:18
或者 npm run dev
```
## 未来考虑