经过4天的努力总算把 两个模块开发出来了,经过一晚上的在云服务器的配置,总算可以发不了哈哈

This commit is contained in:
simple321vip
2022-04-05 23:34:16 +08:00
parent 5c78d43302
commit 1a74970092
11 changed files with 308 additions and 72 deletions
+49 -6
View File
@@ -1,6 +1,6 @@
# Vue 3 + Typescript + Vite + pinia + vue-router
## Vue 3 + Typescript + Vite + pinia + vue-router
# Create project document how to bulid a project
## Create project document how to bulid a project
before create project, you should install node to promit npm and node command is standy.
npm -v
node -v<br />
@@ -14,19 +14,62 @@
cd g-home
npm install
# vue-router
## vue-router
npm install vue-router -S
# pinia
## pinia
// instand of vuex
npm install pinia -S
# element-plus
## element-plus
npm install element-plus -S
# js-cookie
## js-cookie
npm install js-cookie -S
## 环境配置
前后端分离,所以前端单独服务器,所以生产环境需要装node.js
添加了.env.production .env.development 文件
对vite.config.ts做了修改。
# 云服务器的那些坑
// node.js
nodejs 官网直接下载tar.gz 解压到/usr/local/lib/nodejs
// nginx
nginx 这个坑就多了 同样是官网 下载tar.gz 二进制版本 需要编译,但是可能是版本比较新的缘故吧,在make那部出了好多错,最后一查都是云服务器的环境太老了导致的。
// 首先是没有pcre 不用编译直接塞到 /usr/local/src/pcre-8.45
https://sourceforge.net/projects/pcre/files/pcre/8.45/
// 然后又提示 aclocal-1.16: command not found,结果一查就是automake和autoconf的版本问题了
// automake
https://ftp.gnu.org/gnu/automake/ 下载
./configure
make
make install
/usr/bin/autoconf -V
http://ftp.gnu.org/gnu/autoconf/ 下载
./configure --prefix=/usr/
make
make install
到这才把nginx装完
## 发布
- npm run build 生成dist 文件夹
把这个文件夹放到nginx的html文件夹下改名ghome
nginx那个 location /ghome 也要有。