Files
kaifa/本地开发调试.md
2018-11-10 22:21:45 +08:00

72 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

## 本地安装开发调试环境
### nodejs
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
npm -v # 要求 3.10.10
sudo npm i npm@3.10.10 -g
### 建立运行目录
mkdir yunkong2-runtime
cd yunkong2-runtime
### 安装yunkong2 基本框架
npm install https://git.spacen.net/yunkong2/yunkong2/repository/master/archive.tar.gz --production
### 本地运行
node node_modules/yunkong2.js-controller/controller.js
浏览器访问 http://127.0.0.1:8081
![](images/s1.png)
** 注意 ** 适配器请切换到调试模式,也就是上图中的红色图标
### 安装其他基础套件
* web服务器 https://git.spacen.net/yunkong2/yunkong2.web/repository/master/archive.tar.gz
* 魔屏 https://git.spacen.net/yunkong2/yunkong2.material/repository/master/archive.tar.gz
* 可视化VIS https://git.spacen.net/yunkong2/yunkong2.vis/repository/master/archive.tar.gz
*
* 历史数据 https://git.spacen.net/yunkong2/yunkong2.history/repository/master/archive.tar.gz
* 统计图表
* modbus https://git.spacen.net/yunkong2/yunkong2.modbus/repository/master/archive.tar.gz
* JS
按照需要添加实例
## 开发调试
cd node_modules
git clone https://git.spacen.net/...
将准备开发的组件 git 到这个目录
** 注意 ** 这个目录具有git的组件后不允许通过浏览器继续安装其他适配器在安装其他适配器之前必须删除这个目录
文件准备好后,通过浏览器可以看到这个适配器
建议在 git 服务器上调试代码,在本机组件目录下执行 git pull
在适配器管理页面重新 upload 这个组件,注意向上的图标
![](images/s2.png)