Hello,
I have installed node-red using alternate-node-red-installer and created my flows that i want to package using pkg,
I have seen a topic that was closed talking about it but couldn't figure out what to do
Node-RED version: v3.0.2
Node.js version: v16.15.0
pkg version : 5.8.0
Here is what i added in my package.json
I don't know if it's the correct settings because I have all these warnings and errors appearing when running .exe file after the packaging
Well, the first thing to fix are the warnings. They all say the same thing and it points to the httpNodeRoot property in your settings.js - it is set to false which turns off the ability to use http-in nodes. Set it to an empty string instead.
The errors look like they come from you trying to use node.js modules in function nodes. The packager won't have picked those up and so your executable can't do anything when it comes to them. Move the require statements to the globals section of the settings.js file and make sure they are listed as dependencies in the userDir package.json file so that the packager includes them. Then adjust your function nodes to remove the references in setup and change the code to get a reference to the module from the global context.
Thank you so much for your help, it resolved all of the errors and warnings;
And everything works fine on my machine, but when I wanted to share the .exe file along with the UserDir file, it didn't want to start and access refused was written on terminal of another machine
Do you know why perhaps?
And you're working in the directory that node-red-master.exe resides?
if so - is UAC/Defender/Firewall getting in the way? - Given its an executable from 'another location'?
Not sure what else to check, given this is not a "normal" way to run Node RED
Yeah i know it's not the usual way to run it
but i want to distribute my app to clients that's why this is required
anyway , yes i am working in the same directory as node-red-master.exe
maybe it's something to do with defender
(honestly I don't know)