fix(README & package.json): 更新 README 文档以反映 Node.js 版本兼容性,移除 NODE_OPTIONS 环境变量的依赖,确保项目在 Node.js 16 及以上版本下正常运行,优化用户安装指导。

This commit is contained in:
Ryan Ran
2025-10-10 15:23:27 +08:00
parent 3432530de7
commit 1a3fae6501
7 changed files with 21 additions and 197 deletions

View File

@@ -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) [![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)   ![github](https://img.shields.io/github/stars/hongyehuicheng/lilishop.svg?style=social&logo=#181717)
## 2025-9-30日更新 ## 2025-10-10日更新
兼容更高的node版本比如20、18、16不再局限于原本的14版本 兼容更高的node版本16
这里我用的是node版本 v16.20.2
npm版本 8.19.4
没有二开过的项目直接拉最新代码即可,二开项目可以跟着提交记录一起同步修改 install出现问题检查的话删除 "package-lock.json" 重新install 没有二开过的项目直接拉最新代码即可,二开项目可以跟着提交记录一起同步修改 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 保证`node`版本`14`,推荐 14.17.0
2025-9-30日拉的代码之后不限制于node版本 2025-10-10日拉的代码之后不限制于node版本为14这里只是以14版本为例子
可以使用 `yarn` 或者 `npm` 进行安装 可以使用 `yarn` 或者 `npm` 进行安装

View File

@@ -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/).

View File

@@ -3,9 +3,9 @@
"version": "1.0.0", "version": "1.0.0",
"private": true, "private": true,
"scripts": { "scripts": {
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build", "build": "vue-cli-service build",
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve" "dev": "vue-cli-service serve"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=14"

View File

@@ -1,90 +1,5 @@
# LILISHOP-UI # 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 ### Customize configuration
详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/). 详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/).

View File

@@ -5,9 +5,9 @@
"description": "lilishop-ui", "description": "lilishop-ui",
"author": "lili-platform", "author": "lili-platform",
"scripts": { "scripts": {
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", "serve": "vue-cli-service serve",
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build", "build": "vue-cli-service build",
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve" "dev": "vue-cli-service serve"
}, },
"engines": { "engines": {
"node": ">=14" "node": ">=14"

View File

@@ -4,87 +4,6 @@
本文档概述了 LiliShop UI seller 项目的 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 ### Customize configuration
详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/). 详情点击 [https://cli.vuejs.org/zn/config/](https://cli.vuejs.org/zn/config/).

View File

@@ -8,9 +8,9 @@
"node": ">=14" "node": ">=14"
}, },
"scripts": { "scripts": {
"serve": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", "serve": "vue-cli-service serve",
"dev": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve", "dev": "vue-cli-service serve",
"build": "NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build" "build": "vue-cli-service build"
}, },
"dependencies": { "dependencies": {
"@amap/amap-jsapi-loader": "0.0.7", "@amap/amap-jsapi-loader": "0.0.7",