Margrop
Articles241
Tags633
Categories6

Categories

1password 24GB VRAM 2K 3.6 Flash 30B dense 4-bit 量化 6-DoF SLAM AC ACP AI Agent AI Coding Assistant AI Tech AI tutor AI 安全 AI 应用 AI 日记 AI编程助手 ALTK-Evolve AMIE AP API API 定价 API 降价 ARC-AGI-3 ASR ATEM chat 模板 Agent Agent Harness Agent Memory Agent 入侵 Agent 工程 Agent 架构 Agent 检索 Agent 沙箱 Agent 系统 Agent 路由 Agentic AI Agentic tools Ai2 Alertmanager AllenAI Android 17 Antigravity AppDaemon AppWorld Aqara Astra Attention Baseten Benchmark CC-Switch CI/CD CLI Tools CLI工具 CPU 推理 Cache Hit Rate Caddy ChatGPT Claude Code Claude Sonnet ClawLoader Code Interpreter Codex ComfyUI Computer Use Cookie 认证 Cosmos-H-Dreams Cost Optimization Cron DFIR DSpark Date DeepSeek DeepSeek V4 Flash Diagrams.net Diary Diffusers Diffusion Docker Efficiency Tools Embedding English FSDP2 Fable 5 Fireworks AI FlashAttention FlashDreams GGUF GLM 5.2 GLM-5.2 GPT-4.1 GPT-5.6 GPT-Live GPT-Red GPU 加速 GPU 性能分析 Gateway Gemini Gemini 3.5 Flash Gemini API Gemini CLI Gemini Omni Flash Gemma 4 12B Gemma Translator Gemma4 GitHub Actions Google Google AI Google Research Google Sheets Grabette Gripette HA HADashboard HF Security Incident Hailuo Hermes Hexo HomeAssistant Hugging Face IBM Research Inference Providers Isaac Lab Java KV cache Kimi K3 Kubernetes LFM2.5 LFM2.5-VL LLM Router LVM‑Thin Late Interaction LeRobot Linux Liquid AI LiquidAI Live Translate LoRA Luna MCP MTP MacOS Magpie TTS Managed Agents Meta Microsoft 365 Copilot MiniMax Mistral Shieldstral Model Routing MuJoCo Warp Multi-Agent Multi-Vector Muse Glimmer MySQL NAS NIM NVIDIA NeMo Automodel Nemotron 3 Embed Newton Nginx Node.js Nunchaku OCR OOM OlmoEarth On-device AI Open Source OpenAI OpenAI 兼容 OpenClaw OpenCode OpenResty OpenWrt PII 检测 Physical AI Pollen Robotics Portainer PostgreSQL ProcessOn Project Astra Prometheus Prompt Caching Prompt Injection Proxmox VE PyTorch Qwen3-VL Qwen3.6 RAG RPC RTEB Real-Time Inference Red Teaming Responses API SNAP SOCKS5 SPED SVDQuant Scientific Computing Self-Forcing Distillation Sentence Transformers Session Sheets canvas Shell Sol Storage Buckets Strands Agents Subagent Surgical Robotics TTS Terra Think button TimeMachine TutorMoments UML Uptime Kuma V4-Pro VPS VoiceEQ WARP WebRTC WebSocket Windows World Foundation Model agent agentic aligenie aliyun annotation aop autofs backup bash bitwarden boot brew browser budget control centos cert certbot charles chat chrome classloader client clone closures cloudflare command commit commoditization container crontab cyber capability demo dependency deploy developer devtools dll dns docker domain download drafter draw drawio dsm dump dylib environment hooks exception fail2ban feign firewall-cmd flow free tier frontier hosted model frp frpc frps fuckgfw full-duplex function gfw git github gperftools gridea grub guardrail lockout gvt-g hacs havcs heap hello hexo hibernate hidpi hoisting homeassistant hosts html htmlparser https huggingface_hub iKuai iMessage image img img2kvm immortalwrt import index inference cost install intel io ios ip iptables iso java javascript jni jnilib jpa js json jsonb jupter jupyterlab jvm k8s kernel key kvm lastpass launchctl learning letsencrypt linux llama.cpp low-code lvm mac mariadb markdown maven md5 microcode mirror modules monitor mount mstsc multimodal mysql n5105 network nfs node node-red nodejs nohup notepad++ npm nssm ntp oop open weights openfeign openssl os ovz packet capture pdf pem perf pip plugin png powerbutton print pro productive struggle pve pvekclean python qcow2 qemu qemu-guest-agent rar reasoning control reasoning slider reboot reflog remote remote desktop renew repo resize retina router runtime safari sata scaffolding scheduled triggers scipy-notebook scoping scp self-play server serverless inference silent test simulated student so speculative decoding spk spring springboot springfox ssh ssl stash string support svg svn swagger sync synology systemctl systemd template terminal txt ubuntu ui undertow unlocker upgrade vLLM vhd vim vm vmdk web windows with worker xml yum zai-org/GLM-5.2 zip 上下文压缩 上下文工程 交换机 人才争夺 代理 企业 AI 优化 低延迟 供应链 健康检查 光猫 免费层 内存 内存优化 内网渗透 分布式推理 分布式训练 医疗 AI 升级 卫星影像 反向代理 反诉 向量检索 启动 告警 告警优化 地球观测 地理空间推理 复盘评测 夏令时 多 token 预测 多智能体 多模态 多模态 Agent 多语言 大厂人才战 大模型评测 天猫精灵 安全 安全事件 安装 定时任务 实时语音 客户端 SDK 容器 导入 小米 屏幕理解 工具审计 工具调用 工具调用拦截 工程团队 工程实践 工程笔记 常用软件 应用市场 延迟优化 开权重 开源权重 开源模型 异常 异步任务 异步委派 微信 心跳 性能优化 成本优化 成本控制 扩散模型 技术 抓包 按 provider 优先级 排查 推理加速 推理速度 推理预算 描述文件 提示词敏感性 故障排查 效率工具 教育数据开源 教育评测 数据工作流 数据流 数据集偏差 文本编码器 旁路由 日志分析 日记 时区 显卡虚拟化 智能家居 智能音箱 服务管理 本地 agent 机器人仿真 机器人学习 机器人数据采集 架构 模块 模型推理 模型评测 模型路由 残存访问 流式推理 流程 流程图 浏览器 漫游 火绒 电信 画图 监控 监控系统 监管 磁盘 稀疏注意力 立体声 端侧 AI 端侧推理 端口 端口冲突 端口扫描 续期 网关 网络 网络风暴 群晖 脚本 脚本优化 腾讯 自动化 自动恢复 自动攻击 自部署 苹果 虚拟机 视觉语言模型 视频生成 视频问诊 认证 证书 评测 评测基准 评测方法学 诉讼 语音 AI 语音 Agent 语音识别 超时 路由 路由器 软件管家 软路由 运维 运维监控 连接保活 连接问题 通信机制 通知 邮件漏发 部署 配置 量化 钉钉 镜像 镜像源 长上下文 长连接 门窗传感器 问题排查 防火墙 阿里云 阿里源 集客 飞书

Hitokoto

Archive

如何通过 NPM 安装 Node-RED

如何通过 NPM 安装 Node-RED

Node-RED是什么

Node-RED是一种低代码/无代码编程工具,用于以新颖有趣的方式将硬件设备API在线服务连接在一起。特别适用于智能家居

Node-RED提供了一个基于浏览器的流编辑器,可轻松使用面板中的各种节点将流连接在一起。然后,单击即可将流部署到运行时。

可以使用富文本编辑器在编辑器中创建JavaScript函数。
内置库允许您保存有用的功能,模板或流程以供重复使用。

建立在Node.js之上

基于Node.js构建,轻量级的运行环境,充分利用了事件驱动的非阻塞模型。这使得它非常适合在低成本的硬件(如Raspberry Pi)上的网络边缘以及云服务器运行。

Node的软件包存储库中有超过225,000个模块,可以轻松扩展面板节点的范围以添加新功能。

社交共享

Node-RED中创建的流使用JSON存储,可以轻松导入和导出以与他人共享。

在线流程库使您可以与世界分享最佳流程。

安装Node和NPM环境

使用NPM安装

要安装Node-RED,您可以使用node.js附带的npm命令:

1
sudo npm install -g --unsafe-perm node-red

该命令会将Node-RED及其依赖项安装为全局模块。
如果命令输出的结尾类似于以下内容,则可以确认它已成功:

1
2
3
+ [email protected]
added 332 packages from 341 contributors in 18.494s
found 0 vulnerabilities

运行Node-Red

安装为全局模块后,您可以使用node-red命令在终端中启动Node-RED。您可以使用Ctrl-C或关闭终端窗口来停止Node-RED。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ node-red

Welcome to Node-RED
===================

30 Jun 23:43:39 - [info] Node-RED version: v1.1.0
30 Jun 23:43:39 - [info] Node.js version: v10.21.0
30 Jun 23:43:39 - [info] Darwin 18.7.0 x64 LE
30 Jun 23:43:39 - [info] Loading palette nodes
30 Jun 23:43:44 - [warn] rpi-gpio : Raspberry Pi specific node set inactive
30 Jun 23:43:44 - [info] Settings file : /Users/nol/.node-red/settings.js
30 Jun 23:43:44 - [info] HTTP Static : /Users/nol/node-red/web
30 Jun 23:43:44 - [info] Context store : 'default' [module=localfilesystem]
30 Jun 23:43:44 - [info] User directory : /Users/nol/.node-red
30 Jun 23:43:44 - [warn] Projects disabled : set editorTheme.projects.enabled=true to enable
30 Jun 23:43:44 - [info] Creating new flows file : flows_noltop.json
30 Jun 23:43:44 - [info] Starting flows
30 Jun 23:43:44 - [info] Started flows
30 Jun 23:43:44 - [info] Server now running at http://127.0.0.1:1880/red/

然后,您可以通过将浏览器指向http://localhost:1880来访问Node-RED编辑器。

日志输出为您提供各种信息:

  • Node-REDNode.js的版本
  • 尝试加载调色板节点时遇到任何错误
  • 设置文件和用户目录的位置
  • 它正在使用的流文件的名称。
    Node-RED使用flows_<hostname>.json作为默认流文件。您可以通过提供流文件名作为node-red命令的参数来更改此设置。

使用命令行

可以使用命令启动Node-RED node-red。该命令可以使用各种参数:

1
2
3
4

node-red [-v] [-?] [--settings settings.js] [--userDir DIR]
[--port PORT] [--title TITLE] [--safe] [flows.json|projectName]
[-D X=Y|@file]
Option Description
-p, –port 设置运行时侦听的TCP端口。默认:1880
–safe 在不启动流程的情况下启动Node-RED。
这使您可以在编辑器中打开流并进行更改,而无需运行流。
当您部署更改时,流程就开始了。
-s, –settings FILE 设置要使用的设置文件。默认值:<userDir>/settings.js
–title TITLE 设置进程窗口标题
-u, –userDir DIR 设置要使用的用户目录。默认:~/.node-red
-v 启用详细输出
-?, –help 显示命令行用法帮助并退出
flows.json projectName

Node-RED使用flows_<hostname>.json作为默认流文件。如果运行的计算机可能会更改其主机名,则应确保提供一个静态文件名;作为命令行参数或使用设置文件中的flowsFile选项。

如何升级Node-RED

如果已将Node-RED作为全局npm软件包安装,则可以使用以下命令升级到最新版本:

1
sudo npm install -g --unsafe-perm node-red

参考文章

Node-Red
Node-JS
Running Node-RED locally

本文阅读量 --
Author:Margrop
Link:https://blog.margrop.com/post/how-to-install-nodered-with-npm/
版权声明:本文采用 CC BY-NC-SA 3.0 CN 协议进行许可