UPDATE: I solved the problem using online syntax checker at https://esprima.org/demo/validate.html I'm stuck with tmux and the right mouse button. But I would be glad if anyone who reads this message still can share a document or page about the good debugging practices I mentioned in the second paragraph.
I probably made a typo somewhere. But although I have repeatedly inspect it, I could not find the location of the parentheses error. Node-RED does not help me with this. My browser's debugger points to red.js but doesn't provide a hint about my local code. There is no output in node-red-log. I uploaded the latest version of the node which I developed to the (faulty) repository. Can someone take the time and check? Thanks
I just met Node.js and developed a few nodes to experiment with. What I see is that I find it very difficult to debug and report. I generally benefit from node.log and consol.log. My log level is set to debug (settings.js). I follow the browser's console. This much. I have not been able to overcome this problem I am currently experiencing with these methods. It is also sufficient if you can enlighten me about what are good practices for debugging (other than what I mentioned above). I will surely locate the current error.
My node: https://github.com/enseitankado/node-red-contrib-ss963-driver
My settings.js:
logging: {
// Only console logging is currently supported
console: {
// Level of logging to be recorded. Options are:
// fatal - only those errors which make the application unusable should be recorded
// error - record errors which are deemed fatal for a particular request + fatal errors
// warn - record problems which are non fatal + errors + fatal errors
// info - record information about the general running of the application + warn + error + fatal errors
// debug - record information which is more verbose than info + info + warn + error + fatal errors
// trace - record very detailed logging + debug + info + warn + error + fatal errors
// off - turn off all logging (doesn't affect metrics or audit)
level: "debug",
// Whether or not to include metric events in the log output
metrics: false,
// Whether or not to include audit events in the log output
audit: false
}
},
node-red-log output:
17 Jun 06:02:51 - [info] Settings file : /home/pi/.node-red/settings.js
17 Jun 06:02:51 - [info] Context store : 'default' [module=localfilesystem]
17 Jun 06:02:51 - [info] User directory : /home/pi/.node-red
17 Jun 06:02:51 - [warn] Projects disabled : editorTheme.projects.enabled=false
17 Jun 06:02:51 - [info] Flows file : /home/pi/.node-red/flows_raspberrypi.json
17 Jun 06:02:51 - [info] Server now running at http://127.0.0.1:1880/
17 Jun 06:02:51 - [debug] loaded flow revision: d039ad5fb31847b9ad0f9bb4d6708099
17 Jun 06:02:51 - [debug] red/runtime/nodes/credentials.load : no user key present
17 Jun 06:02:51 - [debug] red/runtime/nodes/credentials.load : using default key
17 Jun 06:02:51 - [debug] red/runtime/nodes/credentials.load : keyType=system
17 Jun 06:02:51 - [warn]
---------------------------------------------------------------------
Your flow credentials file is encrypted using a system-generated key.
If the system-generated key is lost for any reason, your credentials
file will not be recoverable, you will have to delete it and re-enter
your credentials.
You should set your own key using the 'credentialSecret' option in
your settings file. Node-RED will then re-encrypt your credentials
file using your chosen key the next time you deploy a change.
---------------------------------------------------------------------
17 Jun 06:02:51 - [info] Starting flows
17 Jun 06:02:51 - [debug] red/nodes/flows.start : starting flow : global
17 Jun 06:02:51 - [debug] red/nodes/flows.start : starting flow : e0f91692.9ca4
17 Jun 06:02:51 - [debug] red/nodes/flows.start : not starting disabled flow : 85db3bb9.799208
17 Jun 06:02:51 - [info] Started flows
^C