# "TypeError: The "options" argument must be of type object. Received an instance of Array" in node-red-contrib-machine-learning

**URL:** <https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917>\
**Category:** General\
**Created:** [15 December 2024 20:16 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917 "2024-12-15T20:16:46Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![SaschaMuehl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/saschamuehl/32/97217_2.png) [@SaschaMuehl](https://discourse.nodered.org/u/SaschaMuehl)\
**Post date:** [15 December 2024 20:16 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917/1 "2024-12-15T20:16:46Z")

</div>

Hey dears,  
I wanna experiment with the Machine Learning Nodes of @GabrieleMaurina. Copying the example flow I get an error:

""TypeError: The "options" argument must be of type object. Received an instance of Array""

The topic were already discussed in 2022 without a solution ([here](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array/67365))

Is there any solution now?

I tried Version 1 and [Version 2](https://flows.nodered.org/node/node-red-contrib-machine-learning-v2)

 ![grafik](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/b/2b2be39f49131dfa3da70c4ea4caf054a5685899.png)

---

<div class="post-metadata">

**Author:** ![marcus-j-davies](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcus-j-davies/32/103435_2.png) [@marcus-j-davies](https://discourse.nodered.org/u/marcus-j-davies)\
**Post date:** [15 December 2024 20:47 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917/2 "2024-12-15T20:47:13Z")

</div>

Welcome to the forums @SaschaMuehl

The author of V2 hasn't updated in 5+ years (V1 +7 years), and both don't provide a way to raise issues - If I were you, I would move on, they both clearly don't maintain the Nodes.

---

<div class="post-metadata">

**Author:** ![SaschaMuehl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/saschamuehl/32/97217_2.png) [@SaschaMuehl](https://discourse.nodered.org/u/SaschaMuehl)\
**Post date:** [15 December 2024 21:50 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917/3 "2024-12-15T21:50:49Z")

</div>

Hi marcus,  
thanks for your reply and welcoming words.

Isn't there a way to mark the nodes as "does not work anymore"?

Hints for creating Machine Learning Models (based on tabular data such as sensor data over time) are more than welcome. I want to classify machine modes (program A, program B...) based on the power consumption.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [16 December 2024 15:55 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917/4 "2024-12-16T15:55:06Z")

</div>

> [@SaschaMuehl](#):
>
> Isn't there a way to mark the nodes as "does not work anymore"?

You can give it one star on the node-red flows site.

I believe there is consideration going on about how to remove obsolete nodes from the node-red catalogue.

---

<div class="post-metadata">

**Author:** ![maxdam](https://avatars.discourse-cdn.com/v4/letter/m/d07c76/32.png) [@maxdam](https://discourse.nodered.org/u/maxdam)\
**Post date:** [7 January 2025 17:00 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917/5 "2025-01-07T17:00:53Z")

</div>

Looking around I found this solution and it seems to work:

in the file /utils/utils.js  
you can replace this:  
_node.proc = spawn(pcmd, [node.file], ['pipe', 'pipe','pipe'])_  
with this:  
_node.proc = spawn(pcmd, [node.file], {stdio:['pipe', 'pipe','pipe']})_

---

<div class="post-metadata">

**Author:** ![SaschaMuehl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/saschamuehl/32/97217_2.png) [@SaschaMuehl](https://discourse.nodered.org/u/SaschaMuehl)\
**Post date:** [11 January 2025 17:21 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917/6 "2025-01-11T17:21:54Z")

</div>

I don't know what this change is doing but this worked well! Thank you @maxdam!

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [25 January 2025 17:22 UTC](https://discourse.nodered.org/t/typeerror-the-options-argument-must-be-of-type-object-received-an-instance-of-array-in-node-red-contrib-machine-learning/93917/7 "2025-01-25T17:22:03Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
