技术专栏
Node-RED系列(十三):三种方式安装启动安装Node-Red
Node-RED系列文章目前已经写了11篇,介绍了Node-RED的安装以及默认安装的一些基本节点的使用,作为物联网的一个可视化拖动的流程,Node-RED的确实很容易上手。还没开始学习的同学可以先看下我以前的文章
由于很多同学问我在安装Node-RED时总是报错,这里我就给大家总结几种非常方便,快捷的安装和开发方式。
在安装时,请大家保持网络畅通,很多包是在国外,需要耐心等待,此外npm的源可以切换成淘宝。
安装方式(一)npm安装
首先需要安装nodejs
sudo npm install -g --unsafe-perm node-red
node-red
源码编译
首先需要安装git, nodejs,可以本地开发。
下载安装
git clone https://github.com/node-red/node-red.git
cd node-red
执行 npm install
执行编辑
npm run build
$ npm run build
> node-red@1.2.9 build D:\download\node-red-master\node-red-master
> grunt build
Running "clean:build" (clean) task
>> 0 paths cleaned.
Running "jsonlint:messages" (jsonlint) task
>> 35 files lint free.
Running "jsonlint:keymaps" (jsonlint) task
>> 1 file lint free.
Running "concat:build" (concat) task
Running "concat:vendor" (concat) task
Running "copy:build" (copy) task
Created 10 directories, copied 83 files
Running "uglify:build" (uglify) task
>> 4 files created 1.93 MB → 745.03 kB
Running "sass:build" (sass) task
Running "attachCopyright:js" (attachCopyright) task
Attached copyright to packages/node_modules/@node-red/editor-client/public/red/red.min.js
Attached copyright to packages/node_modules/@node-red/editor-client/public/red/main.min.js
Running "attachCopyright:css" (attachCopyright) task
Attached copyright to packages/node_modules/@node-red/editor-client/public/red/style.min.css
Done.
开发启动运行
执行 npm start
$ npm start
> node-red@1.2.9 start D:\download\node-red-master\node-red-master
> node packages/node_modules/node-red/red.js
20 Feb 17:28:20 - [info]
Welcome to Node-RED
===================
20 Feb 17:28:20 - [info] Node-RED version: v1.2.9
20 Feb 17:28:20 - [info] Node.js version: v12.15.0
20 Feb 17:28:20 - [info] Windows_NT 10.0.18363 x64 LE
20 Feb 17:28:21 - [info] Loading palette nodes
20 Feb 17:28:22 - [info] Settings file : C:\Users\fizz\.node-red\settings.js
20 Feb 17:28:22 - [info] Context store : 'default' [module=memory]
20 Feb 17:28:22 - [info] User directory : C:\Users\fizz\.node-red
20 Feb 17:28:22 - [warn] Projects disabled : editorTheme.projects.enabled=false
20 Feb 17:28:22 - [info] Flows file : C:\Users\fizz\.node-red\flows_GZDP-DZ-00046.json
20 Feb 17:28:22 - [info] Creating new flow file
20 Feb 17:28:22 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
20 Feb 17:28:22 - [info] Starting flows
20 Feb 17:28:22 - [info] Started flows
20 Feb 17:28:22 - [info] Server now running at http://127.0.0.1:1880/
打开http://127.0.0.1:1880/
停止服务请使用 ctrl+c
docker启动
首先需要安装Docker
docker run -it -p 1880:1880 -v node_red_data:/data --name mynodered nodered/node-red
打开调试日志
Welcome to Node-RED
===================
10 Oct 12:57:10 - [info] Node-RED version: v1.2.0
10 Oct 12:57:10 - [info] Node.js version: v10.22.1
10 Oct 12:57:10 - [info] Linux 4.19.76-linuxkit x64 LE
10 Oct 12:57:11 - [info] Loading palette nodes
10 Oct 12:57:16 - [info] Settings file : /data/settings.js
10 Oct 12:57:16 - [info] Context store : 'default' [module=memory]
10 Oct 12:57:16 - [info] User directory : /data
10 Oct 12:57:16 - [warn] Projects disabled : editorTheme.projects.enabled=false
10 Oct 12:57:16 - [info] Flows file : /data/flows.json
10 Oct 12:57:16 - [info] Creating new flow file
10 Oct 12:57:17 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
10 Oct 12:57:17 - [info] Starting flows
10 Oct 12:57:17 - [info] Started flows
10 Oct 12:57:17 - [info] Server now running at http://127.0.0.1:1880/
r如果需要使用密码登录
docker run -it -p 1880:1880 -v $PWD/data:/data -e TZ=Asia/Shanghai --name nodered -d nodered/node-red
所有安装启动方式 的访问端口都是1880,
打开htpp://localhost:1880 看到以下页面就表示已经安装,启动成功了
声明:本文内容由易百纳平台入驻作者撰写,文章观点仅代表作者本人,不代表易百纳立场。如有内容侵权或者其他问题,请联系本站进行删除。
红包
89
9
评论
打赏
- 分享
- 举报
评论
0个
手气红包
暂无数据
相关专栏
-
浏览量:81036次2020-12-28 16:39:38
-
浏览量:22918次2021-01-04 10:25:54
-
浏览量:22937次2021-03-15 15:40:13
-
浏览量:26828次2021-01-25 17:57:21
-
浏览量:19387次2021-01-22 19:13:39
-
浏览量:34956次2021-02-08 11:42:45
-
浏览量:32789次2021-02-07 17:30:47
-
浏览量:15996次2021-02-08 15:04:50
-
浏览量:13963次2021-03-24 16:14:07
-
浏览量:18501次2021-01-06 19:08:06
-
浏览量:14253次2021-01-14 18:10:48
-
浏览量:25467次2020-12-31 14:58:17
-
浏览量:15252次2021-07-29 17:28:08
-
浏览量:30124次2021-01-05 15:11:35
-
浏览量:14266次2021-03-16 10:46:12
-
2021-04-28 15:04:42
-
浏览量:20297次2021-02-20 17:22:26
-
浏览量:11437次2021-05-11 19:30:21
-
浏览量:12545次2021-06-15 10:26:13
置顶时间设置
结束时间
删除原因
-
广告/SPAM
-
恶意灌水
-
违规内容
-
文不对题
-
重复发帖
打赏作者
这把我C
您的支持将鼓励我继续创作!
打赏金额:
¥1
¥5
¥10
¥50
¥100
支付方式:
微信支付
打赏成功!
感谢您的打赏,如若您也想被打赏,可前往 发表专栏 哦~
举报反馈
举报类型
- 内容涉黄/赌/毒
- 内容侵权/抄袭
- 政治相关
- 涉嫌广告
- 侮辱谩骂
- 其他
详细说明
审核成功
发布时间设置
发布时间:
请选择发布时间设置
是否关联周任务-专栏模块
审核失败
失败原因
请选择失败原因
备注
请输入备注