Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
How to debug your Node-RED node.
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Ryoichi Obara
November 29, 2019
Technology
0
1.6k
How to debug your Node-RED node.
Node-RED UG勉強会 2019 年末LTパーティ
https://node-red.connpass.com/event/153172/
の登壇資料です。
Ryoichi Obara
November 29, 2019
Tweet
Share
More Decks by Ryoichi Obara
See All by Ryoichi Obara
製造業IoTのためのNode-REDカスタムノード開発 #noderedjp #nodered / Developing Industrial IoT Node-RED custom node
ryoichi_obara
0
2.6k
Other Decks in Technology
See All in Technology
Phase07_実務適用
overflowinc
0
1.9k
DDD×仕様駆動で回す高品質開発のプロセス設計
littlehands
6
2.4k
Phase11_戦略的AI経営
overflowinc
0
1.6k
PostgreSQL 18のNOT ENFORCEDな制約とDEFERRABLEの関係
yahonda
0
120
AIエージェント×GitHubで実現するQAナレッジの資産化と業務活用 / QA Knowledge as Assets with AI Agents & GitHub
tknw_hitsuji
0
230
BFCacheを活用して無限スクロールのUX を改善した話
apple_yagi
0
120
来期の評価で変えようと思っていること 〜AI時代に変わること・変わらないこと〜
estie
0
100
Agent Skill 是什麼?對軟體產業帶來的變化
appleboy
0
230
非同期・イベント駆動処理の分散トレーシングの繋げ方
ichikawaken
1
110
A4)シラバスを超えて語る、テストマネジメント
moritamasami
0
130
新規事業×QAの挑戦:不確実性を乗りこなす!フェーズごとに求められるQAの役割変革
hacomono
PRO
0
180
20260320_JaSST26_Tokyo_登壇資料.pdf
mura_shin
0
120
Featured
See All Featured
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
91
Marketing to machines
jonoalderson
1
5k
Exploring anti-patterns in Rails
aemeredith
2
290
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
How to Grow Your eCommerce with AI & Automation
katarinadahlin
PRO
1
160
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
280
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
Test your architecture with Archunit
thirion
1
2.2k
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
210
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
93
What's in a price? How to price your products and services
michaelherold
247
13k
Transcript
Node-REDで デバッグするための 開発環境 2019/11/29 (Fri) Node-RED UG勉強会 2019 年末LT パーティ
@ Uhuru @ ryoichi_obara
@ ryoichi_obara • 中小SIer (製造業向け) IoT / クラウド • 好きなNode-REDノード:
• クラフトビール消費量: 600+ [杯/年] ↓ブログ
Cookbook翻訳してたりもしました
前回 話したこと
今回 話すこと - デバッグについて カスタムノードを開発する際、デバッグノードだけではなく ステップ実行をしたい そのための環境構築
前提 • Node.js インストール済 • VS Code インストール済 • ノードを公開するならgitも
構成の概要 1. Node-REDをローカルで実行するためのディレクトリ 例 C:¥node-red-run-local 2. カスタムノード開発用のディレクトリ (≒ 公開するリポジトリ) 例
C:¥node-red-contrib-your-custom-node npmで 参照(リンク)する VS Codeのワークスペース
ryoichi-obara / node-red-run-local って何? • グローバルではなく、ローカルでNode-REDを実行 • 設定ファイル一式を自ディレクトリ配下に保存するオプション付 • VS
Codeで実行するための設定ファイルも同梱
このオプションが指定してある https://nodered.jp/docs/getting-started/local#コマンドラインの使い方
• cloneする • 依存関係のダウンロード > git clone
[email protected]
:ryoichi-obara/node-red-run-local.git 【任意のdir名】 >
cd 【cloneしたdir名】 > npm i 準備1. node-red-run-local https://github.com/ryoichi-obara/node-red-run-local
準備2. カスタムノード開発用ディレクトリ • ディレクトリ新規作成 • git, npm初期化 • 開発するノードについての -
package.json - ノード名.html - ノード名.js を配置 https://nodered.jp/docs/creating-nodes/first-node > mkdir node-red-contrib-your-custom-node > cd node-red-contrib-your-custom-node > git init > npm init -y
カレントディレクトリを実行環境(run-localの方)にして 開発対象のディレクトリを npm i する (ディレクトリ名/構成は一例) C:¥node-red-run-local> npm i C:¥node-red-contrib-your-custom-node
準備3. npmでリンクする https://nodered.jp/docs/creating-nodes/first-node#node-redでノードの動作確認
準備3. npmでリンクする(イメージ)
準備4. VS Codeでワークスペースの設定 • VS Codeで新しいウィンドウ • フォルダーをワークスペースに追加 - cloneしたローカル実行用ディレクトリ
(≒ node-red-run-local) - 開発用のノード (ここでは node-red-contrib-your-custom-node) • この構成を、 [任意のファイル名].code-workspace として 保存することもできる
構成の概要 (おさらい) 1. Node-REDをローカルで実行するためのディレクトリ 例 C:¥node-red-run-local 2. カスタムノード開発用のディレクトリ (≒ 公開するリポジトリ)
例 C:¥node-red-contrib-your-custom-node npmで 参照(リンク)する VS Codeのワークスペース
実際の画面
実行してみましょう • F5 でローカル実行 • デバッグ用のフローを作成 • inject で動かす •
VS Code 上で F9 でブレークポイントを貼る • また inject で動かす 今度は VS Code のブレークポイントで止まっていることを確認 • F10 でステップ実行 • フローが最後まで動いたことを確認 コアノードもデバッグできるよ! node_modules/@node-red/nodes/core/**
時間があればデモ あるはず・・・!
ご清聴ありがとうございました • 公式ドキュメントは充実しているので、読むと勉強になる • Node-REDはプログラムレスだけど、プログラム書くならVS Code