From 1a3fae6501bd080881253c8e4a4cbc9bdc3e4c04 Mon Sep 17 00:00:00 2001 From: Ryan Ran <1410277647@qq.com> Date: Fri, 10 Oct 2025 15:23:27 +0800 Subject: [PATCH] =?UTF-8?q?fix(README=20&=20package.json):=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=20README=20=E6=96=87=E6=A1=A3=E4=BB=A5=E5=8F=8D?= =?UTF-8?q?=E6=98=A0=20Node.js=20=E7=89=88=E6=9C=AC=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=80=A7=EF=BC=8C=E7=A7=BB=E9=99=A4=20NODE=5FOPTIONS=20?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E5=8F=98=E9=87=8F=E7=9A=84=E4=BE=9D=E8=B5=96?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E9=A1=B9=E7=9B=AE=E5=9C=A8=20Node.j?= =?UTF-8?q?s=2016=20=E5=8F=8A=E4=BB=A5=E4=B8=8A=E7=89=88=E6=9C=AC=E4=B8=8B?= =?UTF-8?q?=E6=AD=A3=E5=B8=B8=E8=BF=90=E8=A1=8C=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E5=AE=89=E8=A3=85=E6=8C=87=E5=AF=BC=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 15 ++++++-- buyer/README.md | 19 ---------- buyer/package.json | 6 ++-- manager/README.md | 85 -------------------------------------------- manager/package.json | 6 ++-- seller/README.md | 81 ----------------------------------------- seller/package.json | 6 ++-- 7 files changed, 21 insertions(+), 197 deletions(-) diff --git a/README.md b/README.md index 9884655b..89001907 100644 --- a/README.md +++ b/README.md @@ -19,11 +19,20 @@ [![star](https://gitee.com/beijing_hongye_huicheng/lilishop/badge/star.svg?theme=dark)](https://gitee.com/beijing_hongye_huicheng/lilishop/stargazers)   ![github](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=#181717) -## 2025-9-30日更新 -兼容更高的node版本,比如20、18、16,不再局限于原本的14版本 +## 2025-10-10日更新 +兼容更高的node版本16 + +这里我用的是node版本 v16.20.2 + +npm版本 8.19.4 + + + 没有二开过的项目直接拉最新代码即可,二开项目可以跟着提交记录一起同步修改 install出现问题检查的话删除 "package-lock.json" 重新install +Q&A 为什么不升级更高的node版本? :因为高node版本 OpenSSL 改动 导致旧版本 Webpack 插件会失效 试了好几次如果兼容的话 需要升级Webpack5以及其他的插件 升级内容较多 为了更稳定的还是尽量少动为主 + **** @@ -40,7 +49,7 @@ https://www.bilibili.com/video/BV1WD87eoE9F/ 保证`node`版本`14`,推荐 14.17.0 -2025-9-30日拉的代码之后不限制于node版本 +2025-10-10日拉的代码之后不限制于node版本为14,这里只是以14版本为例子 可以使用 `yarn` 或者 `npm` 进行安装 diff --git a/buyer/README.md b/buyer/README.md index 4195bc9a..e69de29b 100644 --- a/buyer/README.md +++ b/buyer/README.md @@ -1,19 +0,0 @@ -# new - -## Project setup -``` -npm install -``` - -### Compiles and hot-reloads for development -``` -npm run serve -``` - -### Compiles and minifies for production -``` -npm run build -``` - -### Customize configuration -See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/buyer/package.json b/buyer/package.json index 7e15fa3d..66dd7dba 100644 --- a/buyer/package.json +++ b/buyer/package.json @@ -3,9 +3,9 @@ "version": "1.0.0", "private": true, "scripts": { - "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" + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "dev": "vue-cli-service serve" }, "engines": { "node": ">=14" diff --git a/manager/README.md b/manager/README.md index f3916b65..ec629e11 100644 --- a/manager/README.md +++ b/manager/README.md @@ -1,90 +1,5 @@ # LILISHOP-UI -# LiliShop UI Manager 的 Node.js 版本兼容性 - -本文档概述了 LiliShop UI seller 项目的 Node.js 版本兼容性。 - -## 摘要 - -| 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 版本范围 - ### Customize configuration 详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/). diff --git a/manager/package.json b/manager/package.json index c8a0ebe0..0257c919 100644 --- a/manager/package.json +++ b/manager/package.json @@ -5,9 +5,9 @@ "description": "lilishop-ui", "author": "lili-platform", "scripts": { - "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" + "serve": "vue-cli-service serve", + "build": "vue-cli-service build", + "dev": "vue-cli-service serve" }, "engines": { "node": ">=14" diff --git a/seller/README.md b/seller/README.md index a0bcc1bf..267fcc4d 100644 --- a/seller/README.md +++ b/seller/README.md @@ -4,87 +4,6 @@ 本文档概述了 LiliShop UI seller 项目的 Node.js 版本兼容性。 -## 摘要 - -| 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 版本范围 - ### Customize configuration 详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/). diff --git a/seller/package.json b/seller/package.json index 3f0f2acb..ab3cf288 100644 --- a/seller/package.json +++ b/seller/package.json @@ -8,9 +8,9 @@ "node": ">=14" }, "scripts": { - "serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", - "dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", - "build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build" + "serve": "vue-cli-service serve", + "dev": "vue-cli-service serve", + "build": "vue-cli-service build" }, "dependencies": { "@amap/amap-jsapi-loader": "0.0.7",