levivanzele
levivanzele

Reputation: 736

How to reload nodes in Node-RED without restarting?

Currently every time I make a change to a Node-RED node during development it requires stopping and starting the server to apply changes. This is even required if something minor changes, like just editing a label.

How can I reload nodes in Node-RED without restarting the server? Is it even possible?

Upvotes: 1

Views: 3858

Answers (2)

TheSmartMonkey
TheSmartMonkey

Reputation: 1052

Implement watch mecanisum with nodemon

npm i nodemon -D

nodemon.json

{
  "watch": ["src/**"],
  "exec": "node $NODE_OPTIONS node_modules/node-red/red.js $FLOWS",
  "ext": "js, json, ts, proto, html",
  "ignore": "src/**/*.test.ts, src/**/*.spec.ts"
}

now just launch nodemon command

Upvotes: 0

knolleary
knolleary

Reputation: 10117

Is it even possible?

No - you must restart Node-RED to pickup any changes.

You could use a tool such as nodemon to watch for changes on your node files and automatically restart Node-RED. That helps get your changes picked-up with less manual intervention.

Upvotes: 7

Related Questions