Here is the package.json
that I use - this one from the master folder that contains the Node-RED installation, the userDir folder sits in the "data" subfolder and has a similar package.json file.
{
"name": "node-red-master",
"version": "0.20.5",
"description": "Test environment for developing Node-RED flows",
"main": "node_modules/node-red/red.js",
"scripts": {
"start": "nodemon node_modules/node-red/red.js --userDir ./data",
"inspect": "node --inspect node_modules/node-red/red.js --userDir ./data",
"update": "npm install --unsafe-perm --production node-red",
"check": "npm outdated",
"check-data": "cd data && npm outdated",
"update-data": "cd data && npm update",
"check-master": "npm outdated",
"update-master": "npm update",
"admin": "node node_modules/node-red-admin/node-red-admin.js",
"adminui": "start http://localhost:1880/red/",
"ui": "start http://localhost:1880/ui/",
"log": "sudo journalctl -u nrlive -f -n 0 -o cat"
},
"nodemonConfig": {
"ignore": [
"data/*",
".vscode",
"/src/node-red-contrib-uibuilder/nodes/dist",
"/src/node-red-contrib-uibuilder/nodes/icons",
"/src/node-red-contrib-uibuilder/nodes/src",
"/src/node-red-contrib-uibuilder/nodes/templates",
"/src/node-red-contrib-uibuilder/nodes/uibuilder.html",
"/src/node-red-contrib-uibuilder/node-src"
],
"watch": [
"/src/node-red-contrib-uibuilder/nodes/"
],
"env": {
"NODE_ENV": "development"
},
"ext": "js,html"
},
"keywords": [
"node-red"
],
"author": "Julian Knight",
"license": "MIT",
"dependencies": {
"node-red": "^0.20.5",
"node-red-admin": "^0.1.5"
},
"browserslist": [
"> 0.5%",
"maintained node versions",
"last 2 versions",
"not dead",
"not ie < 11"
]
}
Typically, you install nodemon globally npm install nodemon -g
.
You can use a separate configuration file for it if you like but I prefer to have the settings together in package.json.
You can see the npm start script, that is what starts node-red via nodemon.