Skip to content

Commit

Permalink
使用cross-env自动设置NODE_OPTIONS=--openssl-legacy-provider
Browse files Browse the repository at this point in the history
  • Loading branch information
TransparentLC committed Jun 25, 2024
1 parent 6d6e618 commit 0960c0e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ node main.js

服务端默认会监听本机所有网卡的 IP 地址(也可以自己设定),并在终端中显示前端界面所在的网址,使用浏览器打开即可使用。

如果你使用的是 Node.js 17 或以上的版本,构建前端资源时可能会遇到 `Error: error:0308010C:digital envelope routines::unsupported` 的错误,在终端里设置环境变量 `NODE_OPTIONS=--openssl-legacy-provider` 可以解决这个问题。

#### 使用 Docker 运行

##### 自己打包
Expand Down
9 changes: 5 additions & 4 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"version": "0.1.0",
"private": true,
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build --modern && node after-build.js"
"serve": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service serve",
"build": "cross-env NODE_OPTIONS=--openssl-legacy-provider vue-cli-service build --modern && node after-build.js"
},
"dependencies": {
"axios": "^1.7.2",
Expand All @@ -21,9 +21,10 @@
"@vue/cli-plugin-babel": "^4.5.19",
"@vue/cli-plugin-router": "^4.5.19",
"@vue/cli-service": "^4.5.19",
"cross-env": "^7.0.3",
"fs-extra": "^11.2.0",
"glob": "^10.4.1",
"sass": "~1.77.5",
"glob": "^10.4.2",
"sass": "~1.77.6",
"sass-loader": "^10.5.2",
"typeface-roboto": "^1.1.13",
"vue-cli-plugin-vuetify": "^2.5.8",
Expand Down

0 comments on commit 0960c0e

Please sign in to comment.