forked from knyin/finance
1
0
Fork 0
Finance/Fiance-UI/README.md

58 lines
1.6 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# Fiance-UI
#### 一、编译步骤
**推荐 node 版本12-16**
``` bash
# 安装依赖,采用淘宝镜像加速,可能会出现网络失败的情况,重新执行可以解决
npm install --registry=https://registry.npm.taobao.org
# 启动服务,浏览器打开: localhost:8013
npm run dev
# 构建生产环境名旅客
npm run build:prod
```
#### 二、常见问题
##### 2.1、node-sass 无法安装
linux 系统在安装依赖的时候会出现 node-sass 无法安装的问题解决方案:
```
1. 单独安装npm install --unsafe-perm node-sass
2. 直接使用npm install --unsafe-perm
```
##### 2.2、加速node-sass安装
https://www.ydyno.com/archives/1219.html
##### 2.3 前端Vue编译出错(NodeJS高版本必出现)
```
Vue 报错error:0308010C:digital envelope routines::unsupported
```
主要是因为 nodeJs V17 版本发布了 OpenSSL3.0 对算法和秘钥大小增加了更为严格的限制nodeJs v17 之前版本没影响,但 V17 和之后版本会出现这个错误。 我的[node版本](https://so.csdn.net/so/search?q=node版本&spm=1001.2101.3001.7020)是v18+。
解决方式(仅限 windows:
在项目中 package.json 的 scripts 中新增 SET NODE_OPTIONS=--openssl-legacy-provider添加前
```xml
"scripts": {
"dev": "vue-cli-service serve",
"build:prod": "vue-cli-service build"
},
```
添加后:
```xml
"scripts": {
"dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve",
"build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build"
},
```