Hi everyone,
I'm having trouble with the node-red-contrib-talib node (version 0.0.8), which depends on talib (version 1.1.6). There are two main issues: one with installation on a local Windows PC and another with runtime errors when running in Docker. I've tried reinstalling the nodes, installing TA-Lib manually, and ensuring all dependencies like Python, make, and g++ are present, but the problems persist. I'd appreciate any advice or if anyone has experienced similar issues.
- Installation Failure on Local Windows PC
I'm trying to install node-red-contrib-talib via the Node-RED palette or npm on Windows 10 (Node.js v22.11.0, Node-RED v4.1.0). The installation fails during the node-gyp configure step with a Python-related syntax error. Here's the full log:
2025-09-19T05:52:13.549Z Установить : node-red-contrib-talib 0.0.8
2025-09-19T05:52:13.553Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --omit=dev --engine-strict node-red-contrib-talib@0.0.8
2025-09-19T05:52:16.710Z [err] npm error code 1
2025-09-19T05:52:16.710Z [err] npm error path C:\Users\aiovi\.node-red\node_modules\talib
2025-09-19T05:52:16.710Z [err] npm error command failed
2025-09-19T05:52:16.710Z [err] npm error command C:\Windows\system32\cmd.exe /d /s /c node ./src/lib/build.js && node-gyp configure && node-gyp build
2025-09-19T05:52:16.710Z [err] npm error building talib functions...
2025-09-19T05:52:16.710Z [err] npm error ���⥬� �� 㤠���� ���� 㪠����� ����.
2025-09-19T05:52:16.710Z [err] npm error gyp info it worked if it ends with ok
2025-09-19T05:52:16.710Z [err] npm error gyp info using node-gyp@3.8.0
2025-09-19T05:52:16.710Z [err] npm error gyp info using node@22.11.0 | win32 | x64
2025-09-19T05:52:16.710Z [err] npm error (node:11588) [DEP0060] DeprecationWarning: The `util._extend` API is deprecated. Please use Object.assign() instead.
2025-09-19T05:52:16.710Z [err] npm error (Use `node --trace-deprecation ...` to show where the warning was created)
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! configure error
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack Error: Command failed: C:\Users\aiovi\AppData\Local\Programs\Python\Python310\python.EXE -c import sys; print "%s.%s.%s" % sys.version_info[:3];
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack File "<string>", line 1
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack import sys; print "%s.%s.%s" % sys.version_info[:3];
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack at genericNodeError (node:internal/errors:983:15)
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack at wrappedFn (node:internal/errors:537:14)
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack at ChildProcess.exithandler (node:child_process:419:12)
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack at ChildProcess.emit (node:events:518:28)
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack at maybeClose (node:internal/child_process:1104:16)
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:304:5)
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! System Windows_NT 10.0.19045
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\aiovi\\.node-red\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure"
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! cwd C:\Users\aiovi\.node-red\node_modules\talib
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! node -v v22.11.0
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! node-gyp -v v3.8.0
2025-09-19T05:52:16.710Z [err] npm error gyp ERR! not ok
2025-09-19T05:52:16.711Z [err] npm error A complete log of this run can be found in: C:\Users\aiovi\AppData\Local\npm-cache\_logs\2025-09-19T05_52_13_812Z-debug-0.log
2025-09-19T05:52:16.737Z rc=1
I've tried using PowerShell Core, setting npm config set msvs_version 2015, and installing windows-build-tools with --vs2015, but it still fails on the Python configure step. It seems related to Python 3.10 syntax issues with node-gyp v3.8.0. Has anyone managed to install this on Windows?
- Calculation Error in Docker
I managed to install it in a Docker container (using the official nodered/node-red:4.1.0 image on Alpine Linux). I installed TA-Lib manually (via wget, configure, make, make install) and the dependencies (python3, make, g++). The nodes load fine, but when I run the flow, I get a TypeError: Cannot read properties of undefined (reading 'length') in the MA nodes.
Here's the debug output from the flow:
19.09.2025, 14:35:48node: SMA(3)
msg : error
error
name: "TypeError"
message: "Cannot read properties of undefined (reading 'length')"
stack: string
TypeError: Cannot read properties of undefined (reading 'length')
at MA._inputCallback (/usr/src/node-red/node_modules/node-red-contrib-talib/talib/talib.js:2512:43)
at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:214:26
at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
at Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:206:11)
at Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:190:25)
at Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:499:10)
at deliverMessageToDestination (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:814:40)
at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:830:21)
at process.processImmediate (node:internal/timers:483:21)
19.09.2025, 14:35:48node: Контроль входа
msg.payload : Object
object
startIdx: 0
endIdx: 9
inReal: array[10]
0: 10
1: 12
2: 12
3: 12
4: 12
5: 10
6: 10
7: 10
8: 10
9: 10
optInTimePeriod: 10
19.09.2025, 14:35:49node: 10
msg : error
error
name: "TypeError"
message: "Cannot read properties of undefined (reading 'length')"
stack: string
TypeError: Cannot read properties of undefined (reading 'length')
at MA._inputCallback (/usr/src/node-red/node_modules/node-red-contrib-talib/talib/talib.js:2512:43)
at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:214:26
at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
at Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:206:11)
at Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:190:25)
at Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:499:10)
at deliverMessageToDestination (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:814:40)
at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:830:21)
at process.processImmediate (node:internal/timers:483:21)
19.09.2025, 14:35:49node: 9
msg : error
error
name: "TypeError"
message: "Cannot read properties of undefined (reading 'length')"
stack: string
TypeError: Cannot read properties of undefined (reading 'length')
at MA._inputCallback (/usr/src/node-red/node_modules/node-red-contrib-talib/talib/talib.js:2512:43)
at /usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:214:26
at Object.trigger (/usr/src/node-red/node_modules/@node-red/util/lib/hooks.js:166:13)
at Node._emitInput (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:206:11)
at Node.emit (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:190:25)
at Node.receive (/usr/src/node-red/node_modules/@node-red/runtime/lib/nodes/Node.js:499:10)
at deliverMessageToDestination (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:814:40)
at Immediate._onImmediate (/usr/src/node-red/node_modules/@node-red/runtime/lib/flows/Flow.js:830:21)
at process.processImmediate (node:internal/timers:483:21)
The flow is set up to collect 10 price values using a join node, prepare them as an array, format the payload for TALIB (with inReal as the array and optInTimePeriod set to 10 in the function node), and pass it to MA nodes for SMA calculations with periods 3, 9, and 10. The input looks correct in the debug, but the MA nodes throw the error.
Here's the flow JSON for reference:
flow JSON from your message
I've tried converting the array to floats, ensuring the array length is sufficient, and matching optInTimePeriod to the node settings, but no luck. Is there a known issue with this node in Docker, or am I missing something in the payload format? The error seems to happen at talib.js:2512:43.
Thanks in advance for any help!
[
{
"id": "b78d6715e711035f",
"type": "inject",
"z": "f6f2187d.f17ca8",
"name": "Тест данные 1",
"props": [
{
"p": "payload",
"v": "10",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "price",
"x": 160,
"y": 2460,
"wires": [
[
"8937212e57a65ea0"
]
]
},
{
"id": "20e01f1f00c59311",
"type": "inject",
"z": "f6f2187d.f17ca8",
"name": "Тест данные 2",
"props": [
{
"p": "payload",
"v": "12",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "price",
"x": 160,
"y": 2500,
"wires": [
[
"8937212e57a65ea0"
]
]
},
{
"id": "661279df572d4470",
"type": "inject",
"z": "f6f2187d.f17ca8",
"name": "Тест данные 3",
"props": [
{
"p": "payload",
"v": "15",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "price",
"x": 160,
"y": 2540,
"wires": [
[
"8937212e57a65ea0"
]
]
},
{
"id": "31f5da427acb4492",
"type": "inject",
"z": "f6f2187d.f17ca8",
"name": "Тест данные 1",
"props": [
{
"p": "payload",
"v": "10",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "price",
"x": 380,
"y": 2120,
"wires": [
[
"f2df62d2dce43e29"
]
]
},
{
"id": "e6932e9765edae64",
"type": "inject",
"z": "f6f2187d.f17ca8",
"name": "Тест данные 2",
"props": [
{
"p": "payload",
"v": "12",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "price",
"x": 380,
"y": 2160,
"wires": [
[
"f2df62d2dce43e29"
]
]
},
{
"id": "820a83a61a41c7c2",
"type": "inject",
"z": "f6f2187d.f17ca8",
"name": "Тест данные 3",
"props": [
{
"p": "payload",
"v": "15",
"vt": "num"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "price",
"x": 380,
"y": 2200,
"wires": [
[
"f2df62d2dce43e29"
]
]
},
{
"id": "f2df62d2dce43e29",
"type": "join",
"z": "f6f2187d.f17ca8",
"name": "Сбор цен",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": ",",
"joinerType": "str",
"useparts": false,
"accumulate": true,
"timeout": "2",
"count": "10",
"x": 460,
"y": 2340,
"wires": [
[
"16d0e1a3ca24015a",
"887febe460a4dfe4"
]
]
},
{
"id": "16d0e1a3ca24015a",
"type": "function",
"z": "f6f2187d.f17ca8",
"name": "Подготовка данных",
"func": "// Обеспечиваем что payload является массивом чисел\nif (!Array.isArray(msg.payload)) {\n msg.payload = [msg.payload];\n}\nmsg.payload = msg.payload.map(p => Number(p)).filter(p => !isNaN(p));\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 660,
"y": 2220,
"wires": [
[
"1a3e090f442592ee",
"21b81791ca8773ca"
]
]
},
{
"id": "e6fc94ccd01ffef6",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "MA Результат",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 1040,
"y": 2180,
"wires": []
},
{
"id": "9f3f9c830bfe35eb",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "RSI Результат",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 1040,
"y": 2260,
"wires": []
},
{
"id": "887febe460a4dfe4",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "Контроль входа",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 700,
"y": 2340,
"wires": []
},
{
"id": "8937212e57a65ea0",
"type": "join",
"z": "f6f2187d.f17ca8",
"name": "Сбор цен",
"mode": "custom",
"build": "array",
"property": "payload",
"propertyType": "msg",
"key": "topic",
"joiner": ",",
"joinerType": "str",
"useparts": false,
"accumulate": false,
"timeout": "0",
"count": "10",
"reduceRight": false,
"reduceExp": "",
"reduceInit": "",
"reduceInitType": "",
"reduceFixup": "",
"x": 330,
"y": 2640,
"wires": [
[
"74a74fa1e8e0f3b1"
]
]
},
{
"id": "74a74fa1e8e0f3b1",
"type": "function",
"z": "f6f2187d.f17ca8",
"name": "Подготовка данных",
"func": "// Обеспечиваем, что payload — массив чисел\nif (!Array.isArray(msg.payload)) {\n msg.payload = [msg.payload];\n}\nmsg.payload = msg.payload.map(p => Number(p)).filter(p => !isNaN(p));\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 500,
"y": 2520,
"wires": [
[
"40de27025f597b73",
"43e1e42eda336ccf",
"63332ccfaa89b585",
"dca9a3d741fa18ba"
]
]
},
{
"id": "9efe064de9ac6bb4",
"type": "function",
"z": "f6f2187d.f17ca8",
"name": "SMA вход (fixed)",
"func": "const data = msg.payload;\nif (!Array.isArray(data)) return null;\n\nmsg.payload = {\n startIdx: 0,\n endIdx: data.length - 1,\n inReal: data,\n optInTimePeriod: 10};\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 770,
"y": 2400,
"wires": [
[]
]
},
{
"id": "cdb755bf1a95ac63",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "MA Результат",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 2480,
"wires": []
},
{
"id": "40de27025f597b73",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "Контроль входа",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 540,
"y": 2440,
"wires": []
},
{
"id": "067150187829c780",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "Контроль входа",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 1120,
"y": 2520,
"wires": []
},
{
"id": "b61cfebd066df99f",
"type": "debug",
"z": "f6f2187d.f17ca8",
"name": "Контроль входа",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"x": 1120,
"y": 2560,
"wires": []
},
{
"id": "1a3e090f442592ee",
"type": "MA",
"z": "f6f2187d.f17ca8",
"name": "SMA(3)",
"optInTimePeriod": "4",
"optInMAType": "0",
"x": 860,
"y": 2180,
"wires": [
[
"e6fc94ccd01ffef6"
]
]
},
{
"id": "43e1e42eda336ccf",
"type": "MA",
"z": "f6f2187d.f17ca8",
"name": "SMA(3)",
"optInTimePeriod": "3",
"optInMAType": "0",
"x": 920,
"y": 2480,
"wires": [
[
"cdb755bf1a95ac63"
]
]
},
{
"id": "63332ccfaa89b585",
"type": "MA",
"z": "f6f2187d.f17ca8",
"name": "10",
"optInTimePeriod": "10",
"optInMAType": "0",
"x": 930,
"y": 2520,
"wires": [
[
"067150187829c780"
]
]
},
{
"id": "dca9a3d741fa18ba",
"type": "MA",
"z": "f6f2187d.f17ca8",
"name": "9",
"optInTimePeriod": "9",
"optInMAType": "0",
"x": 930,
"y": 2560,
"wires": [
[
"b61cfebd066df99f"
]
]
},
{
"id": "21b81791ca8773ca",
"type": "RSI",
"z": "f6f2187d.f17ca8",
"optInTimePeriod": "3",
"name": "RSI(3)",
"x": 860,
"y": 2260,
"wires": [
[
"9f3f9c830bfe35eb"
]
]
},
{
"id": "d81f45d47b5e3640",
"type": "global-config",
"env": [],
"modules": {
"node-red-contrib-talib": "0.0.8"
}
}
]