Commit 3c8fa94c authored by Z.&.Y's avatar Z.&.Y
Browse files

项目启动流程

parent b8073827
No related merge requests found
Showing with 35 additions and 0 deletions
+35 -0
## 部署流程
### 安装 node.js 环境
1. 安装 node.js
- 下载安装包
> wget https://nodejs.org/dist/v20.14.0/node-v20.14.0-linux-x64.tar.xz
- 解压安装包
> tar -xvf node-v20.14.0-linux-x64.tar.xz
- 配置环境变量
> ln -s _dirname/node-v20.14.0-linux-x64/bin/node /usr/local/bin
> ln -s _dirname/node-v20.14.0-linux-x64/bin/npm /usr/local/bin
`_dirname` 为 node.js 解压目录
1. 测试
> node -v
> npm -v
显示当前版本号
### 安装pm2
1. 安装pm2
> npm install pm2 -g
### 启动项目
1. 进入项目目录
> cd _dirname
1. 安装依赖
> npm install
1. 启动项目
> pm2 start server.js --watch
> pm2 list
1. 查看控制台日志输出
> pm2 logs server
1. 停止项目
> pm2 stop server
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment